Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ PROGRAMMING: Create a program that includes three classes called automobile, frame, and tires. Each of these classes must do the following: Frame Class: Store

C++ PROGRAMMING:

Create a program that includes three classes called automobile, frame, and tires. Each of these classes must do the following:

Frame Class:

Store the data for the size of the frame (tiny, medium, big)

The condition of the frame (bad, decent, good)

The number of tires it can fit. The number of tires it can fit directly depends on the on the size of the automobile. If the automobile is small, it will have three tires. If it is medium it will have four tires, and if it is large it will have eight tires.

The default constructor for the frame should be a medium sized frame that is in decent condition. You also need three more constructors, one that will allow you to set a size for the frame, one that will allow you to set a condition for the frame, and one to get the number of tires.

Tires Class:

The Tires class must contain variables for the following:

Mileage left

The condition of the tire (bad, decent, good)

The default condition for Tires must be decent. A decent tire must have 25,000 miles available, a good tire must have 50,000 miles available, and a poor tire must have 10,000 miles available. Once again, create a default constructor and an additional constructor that overrides the default condition of the tire.

Automobile Class:

The Automobile class is the final product. consisting of the other objects. You must store the following:

Price, Tires, a Frame, and whether or not it is able to be driven (Boolean).

The condition of the frame and the condition of the tires will determine the price of the automobile. The initial price of all automobiles is 500. The frame will apply a scale of 10, 16 or 24 to this, depending on its condition. The condition of each tire will apply a scale of 3, 4 or 5. Also, an automobile becomes drivable once it has the appropriate number of tires added.

Here are some functions you should use that will be helpful:

addTires

getFrame

isItBuilt- returns a Boolean for whether or not the frame and all tires have been added

testDrive- will take the automobile for a test drive. The integer ittakes in should be the mileage you want the automobile to travel. (Note: mileage affects the price of the automobile)

Display should print all the information of an automobile and its frame and tires.

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_2

Step: 3

blur-text-image_3

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

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

1583474013, 978-1583474013

More Books

Students also viewed these Databases questions

Question

Define data communication.

Answered: 1 week ago