Question: Assignment 7 Name ID Q1. Create a classes to construct a car the with an engine, following the requirements in the Note. Please declare classes

 Assignment 7 Name ID Q1. Create a classes to construct a

car the with an engine, following the requirements in the "Note". Please

Assignment 7 Name ID Q1. Create a classes to construct a car the with an engine, following the requirements in the "Note". Please declare classes in Q1.h and test the classes (create objects and call member functions) in Q1.cpip Note: Create a class named Engine - it has features of weight and engine size; the weight is set to fixed value 30 pbl (using static const), and the engine size should be non-static const. It also has a regular member variable status, which has accelerating, decelerating, idle, stopped status (using enum) define two constructors one is default and another with an argument for engine size (float); both constructors should do initialization in the constructor initializer list - define three member functions readWeight, readSize, and readStatus to return the above defined member variables, respectively; also, define a member function start which starts the engine (set status to idle) .Create a class named Car - it has features of passagers_in_Car (integer) and weight (float), and an engine (using composition from Engine) weight can be protected define a constructor that has an argument for engine size (float); the constructor should initialize engine size and weight in its initializer list define member functions readVWeight, start, and takePassengers, which: returns the weight of the car, starts

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!