Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

make sure you write this program and make sure it meets all the requiremnts and it gives the same output(i have attached output sample below)

make sure you write this program and make sure it meets all the requiremnts and it gives the same output(i have attached output sample below) make sure you make sure the program run and compile
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Assignment Deliverables - You will make a CCourse class, CStudent class, and a CRegistrar class. - Create dynamic arrays of CStudent and CCourse objects. - You will then test your new classes by creating a course, giving students a reference to the course they are taking and having the registrar store all information about students and courses in the university (using dynamic arrays) - A1 should help as starter code. - Your code should test your connections by calling functions like printRegistrarinfo. Learning Objectives 1. Gain more experience creating classes and making objects in C++ from scratch. 2. Learn about information hiding (public and private declarations), functions used in classes, and header files. 3. This assignment is designed to take you 0 students attending). It can be anything you like. Task 2: CStudent (30 points) Write a class CStudent that has private member variables and public functions 1. The member variables are: - String name - Unsigned int id - CCourse* P_course (a pointer to a CCourse object or NULL) - Note: I realize students take more than one class. I am just trying to make the assignment easier. 2. Provide a blank constructor for the CStudent class. The pointer to the CCourse should start as NULL until you set it....and you need to always check if p_course is NULL when using it. 3. Write getter and setter functions for each member variable 4. Write a function printstudentinfo that returns a string or calls cout. See printCourselnfo above. 5. Write a function of YOUR choice relating the CStudents. This could return a Boolean whether a student is taking a particular class or getting the student's first name. Anything you like. Moke sure you test your closses and code BEFORE you move on to the next steps. Phase 2: The Registrar (40 points) Write a new class CRegistrar that stores all CStudent and CCourse information you need. Member variables are all private. Functions are all public. 1. The class will need arrays to store the CStudent objects and CCourse objects. You will also need to know how many students and courses you are storing. If your array of students CAN store 20 students, it doesn't mean you have 20 students. The array is size 20 but the numStudents variable might equal 6. You may also want to record the maximum number of students and courses you can store. 2. Create a constructor that takes two parameters: the maximum number of courses and the maximum number of students. Use these numbers to dynamic arrays of CStudents and CCourses to store your data. 3. Create a destructor ("CRegistrar()) that frees the dynamics arrays IF they are not NULL. 4. Write two functions that act like setters: addstudent and addCourse. These will take a CStudent or CCourse and add them to the data stored. 5. Write 3 accessor functions to get a student or course. Notice you can have two functions called getstudent because they have different parameters. We will look at this concept soon. a. getStudent(unsigned int id) b. getStudent(string studentName) c. getCourse(string courseName) 6. Write getter methods for the number of courses and the number of students currently stored. 7. Write a function getNumRegistered(CCourse _course) that returns the number (unsigned int) of students registered in class p_course. 8. Write a function printRegistrarinfo() that outputs all relevant registrar information to the screen. The sample output calls printRegistrarlnfo twice (the second time after after the max enrollment for BIT2400 is increased). 9. Write a function you choose for CRegistar. This may be printing the students in a particular class, testing that a course isn't over-enrolled or any number of other functions. Have fun with this. 10. Make sure you test your code. I made students and courses based on the data we used in A1. Here are two examples (put in A3 _CourseClass.cpp's main function): CCourse course = CCourse("BIT2400"): course.setName("BIT2 400 ); course.setMaxEnroliment(90): course.setCourseAverage(71.0); reg addCourse(course): CStudent stu = CStudent(); stu.setName("Mehdi Niknam"); stu.setID(12345); stu.setCourse(reg.getCourse("BIT2400")); reg.addStudent(stu): When testing your code make sure you are using pointers correctly. If you change the max enrollment. in BIT 2400, that change should be reflected everywhere BIT2 400 is used afterwards. You should use multiple courses and students and test a variety of different situations such as no-one taking the course or student being registered for a course that isn't at the registrar

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions

Question

12. The x2 value is: (a) 12.162 (b) 21.516 (c) 22.305 (d) 525

Answered: 1 week ago

Question

Chapter 6 Graded Hon >

Answered: 1 week ago

Question

find all matrices A (a) A = 13 (b) A + A = 213

Answered: 1 week ago