Answered step by step
Verified Expert Solution
Question
1 Approved Answer
/ / 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
Step: 1
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