Problem

Create a base class called Vehicl e that has the manufacturer's name (type string), nu...

Create a base class called Vehicl e that has the manufacturer's name (type string), number of cylinders in the engine (type int), and owner (type Person, given below). Then create a class called Truck that is derived from Vehicl e and has additional properties: the load capacity in tons (type double since it may contain a fractional part) and towing capacity in pounds (type int). Be sure your classes have a reasonable complement of constructors, accessor, and mutator member functions, an overloaded assignment operator, and a copy constructor. Write a driver program that tests all your member functions.

The definition of die class Person follows. The implementation of the class is part of this Programming Project.

class Person

{

public:

Person();

Person(string the_name);

Person (.const Person& the_object);

string get_name() const',

Person& operator = (const Person& rt_side);

friend istream& operator >>(istream& in_stream,

Person& person_object);

friend ostream& operator <<(ostream& out_stream,

const Person& person_object);

private:

string name;

};

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 15
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT