Question: / / TODO: Add the three Vehicle objects to the vector using the push _ back ( ) function / / TODO: Print out each
TODO: Add the three Vehicle objects to the vector using the pushback function
TODO: Print out each Vehicle by looping through the vector and calling the Display function for each Vehicle object
Lab Classes Part
The complete assignment description can be found on Canvas under the assignment "Lab
Here you'll just implement the basic Vehicle class and its functions. The class declaration will be written in Vehicle.h while the definitions of the functions will be written in Vehicle.cpp
Tests and are set up for you; you just need to write the Vehicle class for those. For test you will have to fill in the sections that are marked with a TODO comment.
#include
#include
#include "Vehicle.h
using namespace std;
int main
int input;
cin input;
if input
Vehicle defaultVehicle;
defaultVehicle.Display;
else if input
Vehicle customVehicleTesla "Model S;
customVehicleDisplay;
Vehicle customVehicleChrysler "New Yorker", ;
customVehicleDisplay;
else if input
Vehicle customVehicleChrysler "New Yorker", ;
Vehicle customVehicleCOP "Moped", ;
cout "Price of the vehicles: $ customVehicleGetPrice customVehicleGetPrice endl;
else if input
Vehicle customVehicleRazor "Scooter", ;
cout customVehicleGetYearMakeModel;
else if input
Vehicle muscleCarFord "Mustang", ;
Vehicle electricToyota "Prius", ;
Vehicle suvMazdaCX;
vector vehicles;
TODO: Add the three Vehicle objects to the vector using the pushback function
TODO: Print out each Vehicle by looping through the vector and calling the Display function for each Vehicle object
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
