Crate an array of objects from class month with size of five


C++ Assignment

Design a class named Month. The class should have the following private members:

• months- a string of array object that holds the name of a month, such as "January," "February," etc.

• grossAmount- an array of double variable that holds the total amount of each month.

• Structure of Branch that includes:

o branchName shows a name of the branch.
o branchID shows the branch number.
o branchManager shows branch manger name.

You will need to build and provide the following member functions:

• A default constructor that has no arguments and sets all gross Amount to 0.0 to all 12 months.

• A constructor that accepts the name of a month as an argument. It should Search for the name of the month set grossAmount of argument month to 0.0 value.

• A constructor that accepts a double number of grossAmount and the month name as arguments. It should set grossAmount with value passed as the argument to the passed correct month name.

• A constructor that accepts branch items information.

• Appropriate set and get functions for the name of the month and grossAmount variables.

• Appropriate set and get functions for the Branch data structure.

• Member Function that set array of months such as:

o void initializeNames() to set the array of 12 month names: // Initialize the array of month names.

months[0] = "January"; months[1] = "February"; months[2] = "March";
months[3] = "April"; months[4] = "May"; months[5] = "June";
months[6] = "July"; months[7] = "August"; months[8] = "September";
months[9] = "October"; months[10] = "November"; months[11] = "December";

• Function that return the total groosAmount for all 12 months.

• Using Month class the main function shows:

o How to call ALL different constructors, set and get data of the different instance of objects .
o Crate an array of objects from class Month with size of 5.
o Create a function that Sort an array of objects base on total groosAmount on descending order.
o Create a Menu function for user selection to do a Loop for the following:

- select (1) to input 5 data for the array object of class month
- select (2) to display the sort of data objects base on total groosAmount
- Select (3) to exist

Demonstrate the class in a program.

Format your assignment according to the following formatting requirements:

1. The answer should be typed, double spaced, using Times New Roman font (size 12), with one-inch margins on all sides.

2. The response also include a cover page containing the title of the assignment, the student's name, the course title, and the date. The cover page is not included in the required page length.

3. Also Include a reference page. The Citations and references should follow APA format. The reference page is not included in the required page length.

Solution Preview :

Prepared by a verified Expert
Computer Networking: Crate an array of objects from class month with size of five
Reference No:- TGS02957332

Now Priced at $80 (50% Discount)

Recommended (90%)

Rated (4.3/5)