Question: Write a complete C+ program and implement the class vehicle in Figure 1 Detailed members of three classes are given below. Note the comprehensive constructor
Write a complete C+ program and implement the class vehicle in Figure 1 Detailed members of three classes are given below. Note the comprehensive constructor is a constructor for a subclass that provides parameter for initializing properties of both current class and all ancestor classes. Each class is made of one header file and one source file Vehicle Car Truck Figure 1 Class Vehicle Properties (private) o speed: double o weight: double . Constructors o o non-argument constructor: initialize this class's properties with default values standard constructor: number of parameters equals to the number of properties class. It initializes this class's properties with parameters. of this Methods o one get method for each private property: same return type as the corresponding property, no parameter, usually made of one return statement, for reading value of the property o one set method for each private property: void return type, one parameter, for resetting value of the property using the parameter from outside of the class. It is usually made of one assignment statement o display0: no return, no parameter, print name and current value of every property o start0: no return, print how a typical vehicle usually starts. For example, start with key and ignitor Class Car Properties (private) o color: string o model: string
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
