Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write a C++ source file with the Class name: Vehicle. It has private attributes

ID: 645212 • Letter: W

Question

write a C++ source file with the
Class name: Vehicle.
It has private attributes
Car Type (string)
Car Name (string)
Car Year (int) 1 = 1970, 2 = 1980, 3 = 1990, 4= 2000;
Car Rank (double) 0.0-4.0
the Public Member Functions:
1) Public Constructors
    - a default constructor with no paramaters
   -a constructor with paramaters, one paramater for each attribute.
2) Public Member Functions
   - set() method for setting value of each attribute
   -The set() method for car year - before assigning the incomin value, check to see if the incoming value is 1, 2, 3, 4. If its not, assign 0, and print to screen, value not legal.
- a get() method for each attribute.
- a method called Decision, to decide if car is worthy to purchase. Following this: If car is 2000 and rank is 3.8 or higher, return a true value for granting worthyness to purchase.    Otherwise return false value, that means car is not worthy to purchase.
In the same source file write the main() function.
1) create 2 specific Vehicle objects, use object names c1 and c2, giving them specific attribute values. Either through constructor with paramaters, or through set statements after they are created.
2) For each vehicle, retrieve and display the full information using the get() methods and display whether this car is worthy purchase via the Decision method

Explanation / Answer

#ifndef PHP_VEHICLES_H #define PHP_VEHICLES_H #define PHP_VEHICLES_EXTNAME "vehicles" #define PHP_VEHICLES_EXTVER "0.1" #ifdef HAVE_CONFIG_H #include "config.h" #endif extern "C" { #include "php.h" } extern zend_module_entry vehicles_module_entry; #define phpext_vehicles_ptr &vehicles_module_entry;