Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help quickly please Description In this assignment you are to implement the methods of the class VehicleOwner. The class stores information about a vehicle
Please help quickly please
Description In this assignment you are to implement the methods of the class VehicleOwner. The class stores information about a vehicle and its owner. Instructions In Vehic leOwner.cpp define the following methods after the class definition: Constructor with optional parameters This constructor provides default values to each of its parameters. Thus, each parameter is optional and if a value is not provided during object initialization, it defaults to the assigned value. The parameters must be specified in order from left to right. If a parameter is specified, all parameters to its left must also be specified. For example: Vehicle0wner("John") is legal and all parameters starting with last will get the default value. Vehic le0wner(2000) is not legal, since first and last must be specified. Vehicleowner (const string first = "na", const string last = "na", const int year =1900, const string manufacturer = "na", const string model = "na"); - first - owner first name. Defaults to "na" if not specified during instantiation - last - owner last name. Defaults to "na" if not specified during instantiation vehicle model year. Defaults to 1900 if not specified during instantiation getters The two getters to return the composite owner and vehicle information. string getowner() const; returns - the string: first last, i.e. "John Doe" string getVehicle() const; returns - the string: year manufacturer model, i.e. "2020 Honda Civic" setters The two setters to write the owner and vehicle information. Each accepts relevant parameters to update the corresponding owner and vehicle fields. void setowner(const string\& first, const string last); - first - the owner first name. - last - the owner last name. void setVehicle(const int year, const string\& manufacturer, const string\& model); - year - the vehicle model year. - manufacturer - the vehicle manufacturer. - model - the vehicle model descriptor The descriptor method is responsible for returning a formatted string representation of the object. The returned string should be: \{Owner:first last, Vehicle:year manufacturer model\}, i.e. " { Owner: John Doe, Vehic le: 2020 Honda Civic\}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