Highlights
Task
Project Instructions
We are in charge of a drag race and will design a class `Analysis` to handle this. The class has two constructors (one of which takes a visualiser). Modify the main to create three vehicles with provided specifications (for your own visualisation).
You will need to utilise the car library, which is provided for the Task (you don't need to write it), refer to class [Car](./a1/dep/include/car.h) . You will need to pass the cars to the [Analysis](./a1/analysis.h) for further processing, look at the constructor of `Analysis`.
We have a `demoRace` that is just a small demo to show how to accelerate and decelerate the cars. You can comment this out in your code, once you have a feel for how to control the cars. You have to keep accelerating to go faster, and decelerate to slow down (functions available), refer to class [Car](./a1/dep/include/car.h) . You will need to create some cars to run the demo race (determine how to create an object of `Car`), the demo shows the car on a circular track as they race. Unit tests are provided for Task 2 and Task 3.
TASK 1- Sorting cars by odometry
Implement the `sortByOdometry` sorting algorithm, that will sort the vehicles per kilometres in their odometry, sorted in ascending order). You can get some inspiration in completing this using pairs (the value to be sorted as first element, and the previous index as second element) from [sorting pairs](https://www.geeksforgeeks.org/keep-track-of-previous-indexes-after-sorting-a-vector-in-c-stl/).
TASK 2 - Standard drag race
Create a drag racing algorithm, where each vehicle will race a distance of 1km and then stop. So the logic for `dragRace` is:
1. Accelerating each car
2. When all cars cover 1000m (1km) the race is finished, we declare the winners as the first car to cover (travel) 1km.
Return the order of cars in terms of the order they reached the distance.
TASK 3 - Stop all cars
Though we did a drag race, we didn't stop the vehicles (decelerate them to zero speed). Create a function `stopAllCars` in the `Analysis` class to achieve this. This function needs to stop (bring speed to zero) for all cars.
HINTS: (1) use a loop to do this by going over a container of vehicles, (2) what other information needs to be stored to know if to further decelerate each vehicle, (3) remember dangers of comparing float numbers to zero?
TASK 4 - Zero - Top Speed - Zero race
Initial drag race (in TASK 2) favoured high horse power, we have designed another race that is more about power to weight ratios and breaking force. All cars have to reach their individual top speed and then go back to zero speed. So the logic for `zeroTopZeroRace` is
1. Accelerate all cars
2. As each individual vehicle reaches top speed decelerate that car, keep other cars that have not reached their top speed accelerating
3. When all vehicles have stopped, terminate the race
Return the order of vehicles that reached zero speed (the car MUST have reached top speed before coming back to zero speed)
Part B
1) TASK: Implement function `void populateContainer(std::deque
2) TASK: Implement function t`void bubbleSortContainer( std::deque
This IT Computer Science Assignment has been solved by our IT Computer Science Expert at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing Style. Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered.
You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turn tin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.