0% found this document useful (0 votes)
49 views

Lab01-Review-Array-String-Struct-File IO

This document provides an overview of lab 01 for the CSC10002 course. It discusses creating projects with multiple source code files and using functions, arrays, strings, and files. It outlines 5 programming assignments, including sorting dates from a file, finding top students from a file, and Codeforces problems. Students are asked to submit code files and screenshots for online assignments or an explanatory video for the final assignment.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Lab01-Review-Array-String-Struct-File IO

This document provides an overview of lab 01 for the CSC10002 course. It discusses creating projects with multiple source code files and using functions, arrays, strings, and files. It outlines 5 programming assignments, including sorting dates from a file, finding top students from a file, and Codeforces problems. Students are asked to submit code files and screenshots for online assignments or an explanatory video for the final assignment.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

CSC10002 – Programming Techniques

Lab 01
Review

Department of Software Engineering-FIT-VNU-HCMUS


CSC10002 L01 – Review

1
Notes
Create a single solution/folder to store your source code in a week.
Then, create a project/sub-folder to store your source code of each assignment.
The source code in an assignment should have at least 3 files:
• A header file (.h): struct definition, function prototypes/definition.
• A source file (.cpp): function implementation.
• Another source file (.cpp): named YourID_Ex01.cpp, main function. Replace 01 by id of an
assignment.
Make sure your source code was built correctly. Use many test cases to check your code before
submitting to Moodle.
Name of your submission StudentID_Week_NumCompleteAssignments.zip, for example:
18125001_W01_07.zip

2
CSC10002 L01 – Review

2
Content
In this lab, we will review the following topics:
• How to create a project with multiple source code files, at least 1 header file, 1 source file and 1
main() source file.
• How to declare, define and call a function.
• How to use array.
• How to use C-string.
• How to use struct.
• How to load data from a text file, or save data to a text file.

3
CSC10002 L01 – Review

3
Assignments
A: YY: 01 problem / assignment.
H: YY: 05 problems / assignments.

You must submit at least 3 files for each project/assignment: a header file to declare all structures and
functions, a cpp file to implement all declared functions and another cpp file containing your main()
function.

3.1. Assignment 1
Write a program to load an array of dates. Sort the array in ascending order and save the array to
another text file.
For example: in the below file, there are THREE dates. The last line indicates that there is no more date
to load.
input.txt
2019 1 4
2019 12 31
2019 1 15
-1 -1 -1

3.2. Assignment 2
Write a program to load an array of students (id, full name, gpa) from a text file, named “input.txt”. Find
top best-GPA students and output to another text file, named “honors.txt”. The structure/format of 2 files
must be the same.

From now, for Codeforces/Hackerrank/Leetcode… assignments, you need to submit 2 files: a source
code cpp file, and an image/screenshot to prove that your code is ACCEPTED on
Codeforces/Hackerrank/Leetcode.

3.3. Assignment 3
http://codeforces.com/problemset/problem/10/A

3.4. Assignment 4
http://codeforces.com/problemset/problem/11/A

4
CSC10002 L01 – Review

3.5. Assignment 5
Students are asked to record a video to show how to create project with multiple source files, compile,
run and debug in the project using your chosen IDE (Visual Studio, Visual Code, CodeBlock, XCode,
CLion…)
Upload the video in your Youtube account in Unlist or Public mode.
Submit the video link.

You might also like