Question: C++ hello there, i have this code that i have been working on for the past week and do tonight. the code works fine but

C++

hello there,

i have this code that i have been working on for the past week and do tonight. the code works fine but i just figured out that i have to

sumbit it using classes which i have no idea about it. i am not a computer science major but it is a required for me. here is the code:

" You will have the following derived classes from Vehicle:Automobile, Motorcycle."

C++ hello there, i have this code that i have been working

on for the past week and do tonight. the code works fine

but i just figured out that i have to sumbit it using

#include #include #include using namespace std; void inti(struct car *cars,int x); void print(struct car *cars,int &x); void add(struct car *cars, int &x); void remove(struct car *cars, int x); void payment(struct car * cars, int x); struct car{

int milage, model; double price; string type, make; };

int main() { car *cars; int x,z,t; x=0; z=0;t=0; while(z!=5){ cout > z; while(z==1){ cout > x; cars = new car [x]; add(cars,x); break; } while(z==3){ print(cars,x); break; } while(z==2){ remove(cars,x); break; } while(z==4){ payment(cars,x); break; } } delete [] cars;

} void inti(struct car *cars, int x){

for(int i=0; i

cars[i].type=" "; cars[i].make=" "; cars[i].model=0; cars[i].milage=0; cars[i].price=0.0; }

}

void print(struct car *cars, int &x){ for(int i=0; i> cars[i].type; cout > cars[i].make;

cout > cars[i].model;

cout > cars[i].milage; cout > cars[i].price; } } void remove(struct car *cars, int x){ print(cars,x); int z, b; while(z!=1){ cout > b; if(b

} } }

void payment(struct car * cars, int x){ print(cars,x); float c; int b,z,s; while(z!=1){ cout >b; cout > c; if(b> s; if( s==1){ cout

else if(s==2){ break; }

} else{ cout

} } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!