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

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

1 Expert Approved Answer
Step: 1 Unlock

Here is the complete header file content of the Car class based on the given requirements cpp namesp... View full answer

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 Programming Questions!