Hey everyone! I was recently assigned this program in class and have only finished about half the work but am already very confused. I was just hoping that some of you could give it a shot and share what kind of code you came up with. Well here it is any help would be very appreciative.
Create a base class called Vehicle that has the manufacturer's name (type string), number of cylinders in the engine (type int.), and owner (type person given below instructions). Then create a class called Truck that is derived from Vehicle 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 and accessor methods, an overloaded assignment operator, and a copy constructor. Write a driver program that tests all your methods.
The definition of the class Person (as stated above) is below. The implementation of the class is part of this programming assignment.
class Person
{
public:
Person();
Person(string theName);
Person(const Person& theObject);
string getName() const;
Person& operator=(const Person& rtSide);
friend istream& operator >>(istream& inStream, Person& personObject);
friend ostream& operator >>(ostream& outStream, const Person& personObject);
private:
string name;
};
Again thanks to anyone who might be able to give me a hand!