Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help coding this program. The coding language is c++. I dont know what xlr means? This is all the information I have and
I need help coding this program. The coding language is c++. I dont know what xlr means? This is all the information I have and it needs to be in c++.
The purpose of this challenge is to use class associations: compositions and aggregations.
- Write a class Student with three private properties: string name, int acad_year, string id.
- acad_year can hold values from 1 thru 4 to represent freshman, sophomore, junior and senior.
- Create a default constructor in the Student class
- Provide an overloaded constructor for Student that will allow you to set all its private variables. Also, create a setter function to set all its private variables. (this constructor and setter do basically the same thing)
- Write a class Class with three private properties: string courseid, int coursenum, int units.
- Provide a setter function for Class that will allow you to set all of its private variables
- Write a class Registration with the following private properties:
- One instance of Student
- One array of Class. This array will contain 10 elements.
- An int maxunits
- Provide an overloaded constructor for Registration that will allow you to set maxunits, students name, academic year and student ID. In this constructor, you will need to call Students setter function to set the student related values passed in the parameter.
- Write a setter function for Registration what will allow you to add class information (course id, course number and units). As this function is called and class information is received, store this information in the array. This function will only allow adding into the array if the total number of units added so far does not exceed or will not exceed maxunits. This function returns true if it was able to add the class into the array, and false otherwise.
- Write a friend function in Registration that passes the address of an instance of Registration. Use this function to show the registration information. Feel free to design how the information is presented. You should display the student and their registered classes.
- In main, ask the user for the student information
- In main, declare a pointer to Registration: Registration * reg = new Registration( PASS IN THE NECESSARY PARAMETERS );
- In main, write a menu or a loop that allows the user to add class information, prompting for each piece of information. It may make sense to use a menu so that the user can add multiple classes. Be sure to let the user know if a class was successfully added or not (remember that the max units will determine this). The user should be able to add multiple classes.
- Remember to delete the pointer created in Step 10
c++
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started