Complete program for Vehicle class

Completed Posted Dec 8, 2013 Paid on delivery
Completed Paid on delivery

Create and write member functions for an abstract Vehicle class. The class should contain:

• Data members to store the number of wheels and the color of the Vehicle

• Any necessary constructors or destructor

• A non-virtual accessor function, numWheels(), to return the number of wheels

• A virtual function, iAmA(), that returns a const char* or a string, “vehicle”

• A pure virtual function, usage() that prints “I am used to __________”

Create and write member functions for a Bike class. The class should be derived from the vehicle class. The Bike class should have a default 2 wheels. Add the necessary functions. Override the iAmA() function so that it returns “bike”. The usage() function should print “I am used to ride”.

Create and write member functions for a Car class. The class should be derived from the vehicle class. The Car class should have a default 4 wheels. Add the necessary functions. Do not override the iAmA(). The usage() function should print “I am used to drive”.

Use this main() to demonstrate your classes:

int main()

{

Bike B(“blue”);

Car C(“red”);

Vehicle* pv;

cout << [url removed, login to view]() << endl;

cout << [url removed, login to view]() << endl;

[url removed, login to view]();

pv = &B;

cout << pv->numWheels() << endl;

cout << pv->iAmA() << endl;

pv->usage();

pv = &C;

cout << pv->numWheels() << endl;

cout << pv->iAmA() << endl;

pv->usage();

}

C++ Programming

Project ID: #5210026

About the project

5 proposals Remote project Active Dec 8, 2013

Awarded to:

vano101

There is chance to complete this task in hour or two, maybe even sooner.................................................

$11 USD in 1 day
(170 Reviews)
5.9

5 freelancers are bidding on average $27 for this job

dobreiiita

Hello, I am C++ expert and can surely help you here with this project, Please let me know if you are interested. Thank You

$30 USD in 1 day
(111 Reviews)
5.9
DucNA

Hi there, I've read your requirement. Please go to my page to get more review about me. Let's discuss right now. Thanks and best regards, Duc Nguyen

$30 USD in 0 days
(6 Reviews)
3.9
michaelobusek

A proposal has not yet been provided

$30 USD in 3 days
(1 Review)
2.2
wittgensteinz

A proposal has not yet been provided

$35 USD in 1 day
(0 Reviews)
0.0
abbaspalash

A proposal has not yet been provided

$33 USD in 1 day
(0 Reviews)
0.0