Answered step by step
Verified Expert Solution
Question
1 Approved Answer
don't forget about the dynamic array part mentioned in the question because last time when i posted a ques this part was missing. LAB ASSIGNMENT
don't forget about the dynamic array part mentioned in the question because last time when i posted a ques this part was missing.
LAB ASSIGNMENT 3 PRG355 Marks: 2.5% Due: Week 5 lab class Classes and Objects Design a class named Car that contains private data members to store the following data for a Car the car's model (a string) - the average speed the distance to travel . the travel time The Car class should also have the following public member functions: - A function that obtains values of all data members from the user, with the exception of the average speed which will be calculated as distance/travel_time. - A function that returns the car model. . A function that returns the average speed. A function that displays the car's data. The program should create as many Car objects as requested by the user, i.e. a dynamic array of Car objects. Please note that it is required to check for and handle the memory allocation errors. The program will first obtain the cars data from the user. It will then display all cars' data and compute and display which car has the highest average speed for the given distance and travel time. A sample of the program output could be as follows: Car_Model Average_Speed Mazda6 9833 BMW3 110.50 Toyota 95.69 Distance 1000 1000 1000 Time 10.17 9.05 10.45 The highest average speed: BMW3 = 110.50 km hours Submit your cpp file on the BlackBoard into the Assignments folder of your la section and demonstrate your program in the lab classStep 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