Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ code please make into one code please Objective: The main obyectire of thin aukepent is checking the studente ability to woak with ADTs in
C++ code please make into one code please
Objective: The main obyectire of thin aukepent is checking the studente" ability to woak with ADTs in this week's asianen, you wid be mvitive the intertace of an ADT in ordet to conform to the regulements of a larec acsicication. impininentarion and base algorithins tur are opencard to populate it, will requere functionality spociated with inimber of ichicie entites and theie attributes. - Vou must ornate 2 Ante Vehide and Mations Woticke has the followins artritives Trpe Are (i) Lrinct o. Width Maainien Spest. The age mast be in the rane of 1 and 20 tength muat be ith time range tram 1 ta 5 tar cars, and fir so f for mucis. brackis. Mamaper las the folksing arsibut vilun enuit be set no 200 . Maximum speed must be in the range from 140 to 200 for cars, and 120 to 140 for trucks. Manager has the following attributes: int n vehicles: representing the total number of vehicles in the simulation. The value must be set to 200 int n _trucks: representing the number of trucks in the pool of 200 vehicles. Vehicle array[200]: representing the structure that will hold the vehicles bool generated: specifying whether the vehicle list has been created or not The role of this ADT is to provide functionality to the manager, towards generating the vehicle list, printing the list, and editing any vehicle's attributes after their generation. The attributes are all private to ensure that they won't be changed by mistakes or naive implementation. You must use get and set functions to manipulate and access them. ask 1: Populate Vehicle List The manager must be prompted to enter the number of trucks. Then all the attributes for all vehicles must be randomly generated, according to the restrictions listed in the Description section. Possible Actions Generate vehicle List(1) Exit Enter Action: 1 Insert number of trucks out of 200 tota] vehicles: 50 Print each vehicle on the screen, listing each attribute. 3: Edit List Prompt the manager to select an index, representing the vehicle that is to be edited. Then prompt for the attribute that is to be edited: type, age, length, width, max speed, or to exit the editing process. The manager must be able to edit more than one attribute as well as to choose to exit the editing menu. Furthermore, the type-related restrictions of a vehicle's attributes do not apply in the edit mode; the manager should be able to assign width, length, and max speed of type car, to a truck, and vice versa. EDI MODE Enter index of vehicle to edit: 34 type (1) age (2) length(3) width (4) Max Speed(5) Exit(0) What field to change: 3 Current length: 4 Enter new length: 4 type(1) age (2) length(3) width( 4 ) Max Speed(5) Exit(0) What field to change: The manager must have access to a menu, allowing the execution of the above tasks as well as having the option to exit. Given that list manipulation and printing are not possible when the list has not been generated, the possible actions should be filtered accordingly, not allowing the manager to print or edit. Similarly, once the list has been generated, the manager should not have the option to re-generate it. Possible Actions Generate Vehicle List (1) Exit (4) Enter Action: Figure 4. Menu Prior to List Generation Figure 5. Menu ofter List Generation If illegal values are inserted by the manager, both in the main menu and edit mode, program should continue prompting for valid input until one is given. Submission notes: - Zip the entire Code::Blocks project containing all the .cpp, .h, .cbp files name the zipped file "Assg7 cslogin.zip", where the cslogin is your login ID for the computers at the Department of Computer Science at ODU. - Submit the zipped file using the appropriate Blackboard link. Objective: The main obyectire of thin aukepent is checking the studente" ability to woak with ADTs in this week's asianen, you wid be mvitive the intertace of an ADT in ordet to conform to the regulements of a larec acsicication. impininentarion and base algorithins tur are opencard to populate it, will requere functionality spociated with inimber of ichicie entites and theie attributes. - Vou must ornate 2 Ante Vehide and Mations Woticke has the followins artritives Trpe Are (i) Lrinct o. Width Maainien Spest. The age mast be in the rane of 1 and 20 tength muat be ith time range tram 1 ta 5 tar cars, and fir so f for mucis. brackis. Mamaper las the folksing arsibut vilun enuit be set no 200 . Maximum speed must be in the range from 140 to 200 for cars, and 120 to 140 for trucks. Manager has the following attributes: int n vehicles: representing the total number of vehicles in the simulation. The value must be set to 200 int n _trucks: representing the number of trucks in the pool of 200 vehicles. Vehicle array[200]: representing the structure that will hold the vehicles bool generated: specifying whether the vehicle list has been created or not The role of this ADT is to provide functionality to the manager, towards generating the vehicle list, printing the list, and editing any vehicle's attributes after their generation. The attributes are all private to ensure that they won't be changed by mistakes or naive implementation. You must use get and set functions to manipulate and access them. ask 1: Populate Vehicle List The manager must be prompted to enter the number of trucks. Then all the attributes for all vehicles must be randomly generated, according to the restrictions listed in the Description section. Possible Actions Generate vehicle List(1) Exit Enter Action: 1 Insert number of trucks out of 200 tota] vehicles: 50 Print each vehicle on the screen, listing each attribute. 3: Edit List Prompt the manager to select an index, representing the vehicle that is to be edited. Then prompt for the attribute that is to be edited: type, age, length, width, max speed, or to exit the editing process. The manager must be able to edit more than one attribute as well as to choose to exit the editing menu. Furthermore, the type-related restrictions of a vehicle's attributes do not apply in the edit mode; the manager should be able to assign width, length, and max speed of type car, to a truck, and vice versa. EDI MODE Enter index of vehicle to edit: 34 type (1) age (2) length(3) width (4) Max Speed(5) Exit(0) What field to change: 3 Current length: 4 Enter new length: 4 type(1) age (2) length(3) width( 4 ) Max Speed(5) Exit(0) What field to change: The manager must have access to a menu, allowing the execution of the above tasks as well as having the option to exit. Given that list manipulation and printing are not possible when the list has not been generated, the possible actions should be filtered accordingly, not allowing the manager to print or edit. Similarly, once the list has been generated, the manager should not have the option to re-generate it. Possible Actions Generate Vehicle List (1) Exit (4) Enter Action: Figure 4. Menu Prior to List Generation Figure 5. Menu ofter List Generation If illegal values are inserted by the manager, both in the main menu and edit mode, program should continue prompting for valid input until one is given. Submission notes: - Zip the entire Code::Blocks project containing all the .cpp, .h, .cbp files name the zipped file "Assg7 cslogin.zip", where the cslogin is your login ID for the computers at the Department of Computer Science at ODU. - Submit the zipped file using the appropriate Blackboard link 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