Question: Coding Question Code the complete header file content of a class called Car with the following requirements: [16 marks] Note: you only need to write
Coding Question

Code the complete header file content of a class called Car with the following requirements: [16 marks] Note: you only need to write the class, its attributes and the desired method prototypes; no function definitions are to be written This class will encapsulate a Car with the following information: Namespace name. tesla Encapulated attributes: . License plate Capacity (maximum number of passengers) . Make and Model (Dynmically allocated Construction and Destruction: The class should be able to be constructed in one of the following ways 1- Using Make-Model , License plate and capacity In this case, if capacity is not provided, it is to be set to 4 by default. 2- With no information provided. (Invalid empty state) Destruction: When going out of scope the class should deallcated its dynamic memroy. Operators: 1- A Car can be set to an integer using assignment operator (to set its capacity) 2- A Car can be set to a Cstring using assignment operator (to set its Make and model) 3- If casted to a boolean it should return if it is in a valid state or not. 4- sum of two cars should return the sum of the capcity of the cars using the + operator
Code the complete header file content of a class called Car with the following requirements: [16 marks] Note: you only need to write the class, its attributes and the desired method prototypes, no function definitions are to be written This class will encapsulate a Car with the following information: Namespace name: tesla Encapulated attributes: . License plate Capacity (maximum number of passengers) Make and Model (Dynmically allocated Construction and Destruction: The class should be able to be constructed in one of the following ways 1- Using Make-Model, License plate and capacity In this case, if capacity is not provided, it is to be set to 4 by default. 2- With no information provided. (Invalid empty state) Destruction: When going out of scope the class should deallcated its dynamic memroy. Operators: 1- A Car can be set to an integer using assignment operator (to set its capacity) 2- A Car can be set to a Cstring using assignment operator (to set its Make and model) 3- If casted to a boolean it should return if it is in a valid state or not. 4- sum of two cars should return the sum of the capcity of the cars using the operator.
Step by Step Solution
There are 3 Steps involved in it
Here is the complete header file content of the Car class based on the given requirements cpp namesp... View full answer
Get step-by-step solutions from verified subject matter experts
