Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

YZV 201E - Data Structures

Exercise #1

Introduction
For this assignment, you are expected to implement a program called Cinova, a Ninova-like course man-
agement system that works from the console. Users can list students, update student information, add a
new student, remove a student, and calculate student’s average.

For any issues regarding the assignment, please contact Barış Bilen ( bilenb20@itu.edu.tr ).

Implementation Notes
1. Please follow a consistent coding style (indentation, variable names, etc.) with comments.

2. Please do not use any pre-compiled header files or STL commands.


3. Be careful about any possible memory leaks and invalid memory use. Check your code with Valgrind.

1
1 Implementation Details
You are expected to implement 2 classes; Student, Course.

1.1 Student
Public Attributes:
Student class has a name (a dynamic character array ), id (a character array with size 9),and grades
(an integer array with size 3).

!
Notice: Student class has no method to implement.

1.2 Course
Public Attributes:
Course class has a course_name (a character pointer), and course_stream (a fstream object).

Methods:
1. create: To create a file to store data.
2. close: To close the file that is created.
3. add: Request required information from the user. Create a new student, then add that student to
the file.
4. remove: Request student id from the user. Remove that student from the file properly (without
changing that line with blank characters).
5. update: Request student id from the user. Update that student’s grade information in the file.

6. list: Read the course file and print all student’s information to the console.
7. get_average: Request student id from the user. Print that student’s average grade if that student
exists. If the input is "*", print average grade of every student.

2 Program Flow
First, print a menu to user to show them possible actions (course class methods). Based on the input from
the user, perform an action.

You might also like