CSP2151 - Programming Fundamentals - Automated Crash Test System - IT Assessment Answer

Download Solution Order New Solution
Assessment Task:
CSP2151 - Programming Fundamentals IT Assessment Answer

 

Tasks: Design and implement the following tasks to manage the simulation of an Automated Crash Test System.

Your program should first load the names of up to 10 vehicles from a file named “Vehicle.txt” and load the names of up to 10 obstacles from a file named “Obstacle.txt” and store them in two arrays of structures, one for vehicles and the other for obstacles. The minimum requirement for the data structures representing a vehicle and an obstacle can be found in Section (1).

Next, the program should display a Menu that allows the user to navigate through and execute the following options:

• Search a vehicle

• Search an obstacle

• Input/update vehicle information

• Input/update obstacle information

• Simulate a vehicle crash against an obstacle

• Display simulation results

• Display all results

• Save all results

• Save vehicle/obstacle information

• Exit

The “Search a vehicle” feature should allow the user to search for information of a vehicle by its Vehicle_Name. Information stored in the related entry/entries in the vehicle array will be displayed. If the vehicle is not found, an error message should be displayed. The “Search an obstacle” feature is similar, but it searches information of an obstacle instead.

The “Input/update vehicle information” feature allows the user to input information of a vehicle. If the input Vehicle_Number matches an existing vehicle, the information entered is used to 2 updates the information of the vehicle stored in the array of vehicles. Otherwise,a new entry is created in the array of vehicles and information is stored there. The “Input/update obstacle information” feature is similar, but it inputs/updates information of an obstacle instead.

The “Simulate a vehicle crash against an obstacle” feature should allow the user to select a vehicle and an obstacle (from the respective arrays), and then simulate a vehicle crash scenario. Detailed simulation task is described in “Vehicle crash test simulation” section.

The “Display simulation results” feature should allow the user to choose a vehicle (e.g., by its vehicle name) and display all test simulation results against some or all obstacles. If the vehicle has not yet been tested (i.e., no simulation was recorded), the program should inform the user that they must test that vehicle before displaying any results of the vehicle/s. If multiple vehicles have the same name, all vehicles’ test results with that name should be displayed.

The “Display all results” feature should display an error message if no vehicle has been tested. Otherwise,it displays the results of all vehicles that have been tested.

The “Save vehicle/obstacle information” feature should extract all vehicle names from the vehicle array and save them back to “Vehicle.txt” file. It also extracts all obstacle names from the obstacle array and saves them back to “Obstacle.txt” file for possible future use/test. For simplicity, only up to 10 (vehicle/obstacles) names are required to save.

The “Save all results” feature should display an error message if no vehicle has been tested. Otherwise,it creates a file, named “results.txt”, and save the names and test results for all vehicles that have been tested, to the file.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.