developing a program that will manipulate noise levels (measured in decibels) that is collected by car manufacturers. These noise levels are produced at seven different speeds by a maximum of six different models of cars that are produced by the car manufacturer.
Task 1
Step 1: Create a directory called Assignment02 and create the files of steps 2, 3 and 4 in this directory as well as your project file.
Step 2: Create a file called NoiseLevels.cpp.
Step 3: Create a file called CarManufacturer.cpp.
Step 4: Create a file called MainMenu.cpp.
Step 5: Create a file called Run.cpp.
NoiseLevels.cpp
You must write a class called NoiseLevels and save it in a file called NoiseLevels.cpp.
The general purpose of this class is to calculate average noise levels.
This class must:
Be a back-end class.
Have a data member of a one-dimensional array to hold the seven different speeds at where the noise levels are recorded (See Fig. 2).
Have a data member of a two-dimensional array that can store, for a maximum of 6 models of cars, the noise levels at the 7 different speeds stored in the first array (See Fig. 2).
Have a constructor that will set the seven different speeds of the one-dimensional array to those appearing in Fig.2 below, and set all the two-dimensional arrays values to zeroes.
Have a member function called setNoiseLevels that will receive two parameters: an integer value representing the number of the car model whose noise levels must be set, and a one-dimensional array that is used to set the 7 noise levels for that car model.
Have a member function called calculateAveNoiseLevelPerSpeed that will return a one-dimensional array that will hold the calculated average noise level for each of the 7 speeds at which it was measured, for all cars that contain noise levels. The function should receive an integer value indicating the number of car models whose noise levels are stored in the two-dimensional array.
Have a member function called calculateAveNoiseLevelPerCar that will return a one-dimensional array that will hold the calculated average noise level for that specific car, for the 7 speeds at which it was measured. The function should receive an integer value indicating the number of car models whose noise levels are stored in the two-dimensional array.
Have a member function called calculateOverallAveNoiseLevel that will return the overall average noise level, receiving integer value indicating the number of car models whose noise levels are stored in the two-dimensional array.
NOT have any additional methods besides the ones specified in this question.
Car Speed(km/h)
20 30 40 50 60 70 80
1 88 90 94 102 111 122 134
2 75 77 80 86 94 103 113
3 80 83 85 94 100 111 121
4 68 71 76 85 96 110 125
5 77 84 91 98 105 112 119
6 81 85 90 96 102 109 120
Fig. 2: An EXAMPLE of the Data for the Two-Dimensional Array
CarManufacturer.cpp
You must write a class called CarManufacturer and save it in a file called CarManufacturer.cpp.
The general purpose of this class is to represent the data pertaining to a specific car manufacturer, with emphasis on the storage and calculation of noise levels for various models.
This class must:
Be a front-end class.
Contain code that will prevent CarManufacturer.cpp file to be defined twice.
Must contain a character array to hold the name of the car manufacturer.
Must hold an integer value to store the number of models that the car manufacturer produces.
Hold a one-dimensional array of strings, of size 6, to store the names of the models.
Hold an object of type NoiseLevels to hold the noise levels for the number of car models the car manufacturer produces.
Have a private member function called enterNoiseLevelData that receives the an integer model number and will prompt for and read the noise levels for that car model into a one-dimensional array and set these values in the object of type NoiseLevels.
Have a public member function called setCarManufacturerData that will enable the end-user to interactively set the name of the car manufacturer, the number of models that the manufacturer produces, the names for these models, as well as noise level data.
Have a private member function called displayResult that receives a floating point array and the number of elements in the array, and display the values stored in the array.
Have a member function called doNoiseLevelCalculations that will display the following menu, and execute the correct member functions based on the option selected, displaying the result:
=======NOISE LEVEL CALCULATIONS=======
1. Calculate Average Noise Level per Car Model
2. Calculate Average Noise Level per Speed
3. Calculate Overall Noise Level Average
4. Exit
Please select an option
Fig. 3
This menu must enable the end-user to execute the different menu options. This menu must also be displayed until option 4 is selected.
If the user enters the wrong number the program must display a message informing the end-user that the entered number is not a valid option and display the menu again.
NOT have any additional methods besides the ones specified in this question.
MainMenu.cpp
You must write a class called MainMenu and save it in a file called MainMenu.cpp.
The general purpose of this class is to display a menu.
This class must:
Be a front-end class.
Only have one public member function called showMenu() that will display a menu as follows:
=======MAIN MENU=======
1. Enter Car Manufacturer Data
2. Calculate Noise Level Averages
3. Exit
Please select an option
Fig. 1
This menu must enable the end-user to execute the different menu options. This menu must also be displayed until option 4 is selected.
Options 1 to 2 must make use of the classes below to execute the options. If the user enters the wrong number the program must display a message informing the end-user that the entered number is not a valid option and display the menu again.
Run.cpp
You must write a main program and save it in a file called Run.cpp.
The general purpose of this program is to supply the end-user with a menu that will enable him/her with the ability to specify the car manufacturer data, and to determine averages on the noise levels entered.
Main must start the MainMenu class.