Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Here is the complete header file content of the Car class based on the given requirements cpp namesp...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