Answered step by step
Verified Expert Solution
Link Copied!

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.

  1. Write a class Student with three private properties: string name, int acad_year, string id.
    1. acad_year can hold values from 1 thru 4 to represent freshman, sophomore, junior and senior.
    2. Create a default constructor in the Student class
  2. 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)
  3. Write a class Class with three private properties: string courseid, int coursenum, int units.
  4. Provide a setter function for Class that will allow you to set all of its private variables
  5. Write a class Registration with the following private properties:
    1. One instance of Student
    2. One array of Class. This array will contain 10 elements.
    3. An int maxunits
  6. 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.
  7. 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.
  8. 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.
  9. In main, ask the user for the student information
  10. In main, declare a pointer to Registration: Registration * reg = new Registration( PASS IN THE NECESSARY PARAMETERS );
  11. 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.
  12. Remember to delete the pointer created in Step 10

c++

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

More Books

Students also viewed these Databases questions