Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

IBM Db2 11 1 Certification Guide Explore Techniques To Master Database Programming And Administration Tasks In IBM Db2

Authors: Mohankumar Saraswatipura ,Robert Collins

1st Edition

1788626915, 978-1788626910

More Books

Students also viewed these Databases questions

Question

How can leaders be most effective?

Answered: 1 week ago