CSstudents students_registered[SIZE];
based on using what you have right now although I might use different name.using namespace std;
as it WILL get you in trouble some day. You can do a search here to read what many people have posted in the past. This is also useful reading:using namespace std;
and you find tht you have no idea what to do.
|
|
ifstream CSstudent;
. This is defined as an input stream, so in CSstudent.open("CSstudents.txt", ios::in);
the "std::ios::in" is not needed. It is actually redundant.
|
|
system("pause");
is not something that everyone can use. It is specific to Windows. And using "system" anything could allow the program to be hacked. To put a pause you have several choices. For a timed pause:std::this_thread::sleep_for(std::chrono::seconds(3)); // Requires header files "chrono" and "thread"
|
|
You are required to build the course approval system. Currently, during the registration week academics manually check if a student is meeting prerequisites for a given course. Write a object oriented program in C++ to solve this problem. For simplicity assume there is no more than one prerequisite for any given course. Three sample files are given for you in Fig.1 to verify your program. Courses.txt shows courses with corresponding prerequisites (0 means a course is offered in both semesters 1 means that course is offered in semester 1 and 2 means that a course is offered in semester 2), CSstudents.txt shows list of courses passed by the students, Students.txt shows list of students at USP and Registration.txt shows list of students with current registration. Do not change the format (columns and first row) of the sample files so that your program can read any file of the same format. For any further clarification post your questions on Moodle. Some rules apart from prerequisite for courses apply during registration: ∙ A student can enrol in at most two courses per semester. ∙ A student can only do courses at the same level i.e. if a student has passed all CS course than the student can do courses from upper level. Currently its semester 2. Requirements 1. This problem must be solved using the Object-Oriented programming paradigm. You need four classes namely student, course, registration and CSstudents. 2. Create a project in Dev C++ and write class definitions for the above mentioned classes (header files). 3. Implement the member functions of the classes you defined in part 2 above (c++ files). 4. Add a source file to your project, the main_driver.cpp. The driver program should be able to do the following: ∙ Create necessary arrays to store the records of the file. The arrays will be of type classes you have defined. ∙ Read the data file for up to size of 100. ∙ Create a menu for the user that can do the following: ∙ Exit program ∙ Display all students at USP ∙ Display all Courses offered at USP ∙ Display details of students (id, name, age, and phone) registered in a course entered by user. ∙ Register a student into a course. This should also add detail in the necessary files and array. Note, registration has some rules apart from prerequisite of a course. ∙ Display all registration ∙ Display number of semesters a student will take to complete all CS courses. The user will provide an id number and the program should calculate the number of semesters left. ∙ Except the first menu, all others should be implemented using functions of the main program. |