Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
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