Question: just need answer for q3 please Q1: Create a class named Vehicle. (20pt) 1. Private data member: brand - dynamic member string 2. Default constructor

just need answer for q3 please  just need answer for q3 please Q1: Create a class named
Vehicle. (20pt) 1. Private data member: brand - dynamic member string 2.
Default constructor - set brand to "TBD" 3. One argument constructor to
set brand 4. Output function - print brand of Vehicle 5. Mutator

Q1: Create a class named Vehicle. (20pt) 1. Private data member: brand - dynamic member string 2. Default constructor - set brand to "TBD" 3. One argument constructor to set brand 4. Output function - print brand of Vehicle 5. Mutator and accessor function for brand Use following main() to test your function. int main() Vehicle a,b("BMW"); a.output(); // Brand:TBD b.output(0; // Brand:BMW a.setBrand("Tesla"); coutoutput():// Brand:Honda Weight: 2000 t= new Boat("Baja ,150) : t>output): Brand:Baja hullLength: 100 delete e: delete f : Output from main: Brand: TBD Weight: 0 Brand: Honda Weight: 2000 Brand: Tesla Weight: 3000 Brand: TBD hullLength: 0 Brand: Baja hulllength: 100 Brand: Bertram huLLLength: 60 Brand: BMW Weight: 20000 Brand: Baja hulLLength: 150 Car Destructor. Vehicle Destructor. Boats Destructor. Vehicle Destructor. Boats Destructor. = Vehicle Destructor. = Boats Destructor. Vehicle Destructor. Car Destructor. Vehicle Destructor. Car Destructor. Vehicle Destructor. Answer. Q3: Continue of previous question (40pt) 1. Copy the previous program to a new file. 2. Create a class called VehicleNode. 3. Create a class called VehicleList. 4. Implement add function to VehicleList - add new vehicle to the end of the VehicleList 5. Implement print function to VehicleList - print every vehicle of the VehicleList 6. Implement add tunction to VehicleList - Remove the last added vehicle from VehicleList Use tollowing main0 to test your function. int main0. VehicleList list; list.add(new Car("Honda",1000)); list.add(new Car("BMW",2000)); list.add(new Boat("Baja", 100)): list.add(new Car("Tesla", 3000)); list. add(new Boat(" Bertram", 60)); list.add(new Car("Toyota", 4000)): list.print(); list.remove0; list.remove()

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!