Question: Please write in a UI and make sure the code is compiling corretly please :)) Assignment #7 Problem Solving and Programming in Ctt Deportment of




Assignment \#7 Problem Solving and Programming in Ctt Deportment of Computer Science Old Dominion University bjective: The main objective of this assignment is checking the students ability to work with Ts. In this week's asslgnment, you will be writing the interface of an ADT in order to conform the requirements of a larger application. escription: You have joined a team working on a traffic simulation framework. The framework plementation and base algorithms that are expected to populate it, will require functionality sociated with number of vehicle entities and their attributes. - You must create 2 ADTs: Vehicle and Manager. Vehicle has the following attributes: Type Age Length Width Maximum Speed The type attribute must accept only two values: car, and truck. The age must be in the range of 1 and 20. Length must be in the range from 3 to 5 for cars, and 6 to 8 for trucks. Width must be in the range from 1 to 2 for cars, and 2 to 3 for trucks. 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 vehicies. 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. e attributes are all private to ensure that they won't be changed by mistakes or naive plementation. You must use get and set functions to manipulate and access them. Task 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 tota7 vehicles:50 Figure 1. tist Generation Process. Task 2: Print Vehicle List Print each vehicle on the screen, listing each attribute. k 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 cype (1) age (2) length(3) width(4) Max Speed(5) Exit(0) what field to change: sk 4: Main Menu 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 Generotion If illegal values are inserted by the manager, both in the main menu and edit mode, the program should continue prompting for valid input until one is given. Grading Rubric CS250 Assignment 7 Total Points: 100 Points Allotted: - Compilation and running as expected 30 - Correct number of files: .h, and .cpp, .txt files 5 - Correctly using getter and setter functions 10 - Constructors implementation 10 - Member variables are private 10 - Editing 10 - Printing List 10 - List Generation 10 - Style: Comments and indentations 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
