Question: You are writing a program in C++ to help Ikea's loading dock make deliveries. Ikea has two type of vehicles that can make deliveries. Cars
You are writing a program in C++ to help Ikea's loading dock make deliveries. Ikea has two type of vehicles that can make deliveries.
Cars and Trucks. A Truck can hold 950 pounds of cargo. A Car can hold 300 pounds, but can't take any single item that is over 75 pounds.
Ikea sells two pieces of Furniture this summer. Bookcases weigh 100 pounds and Chairs weigh 40 pounds.
Your program needs to first ask if the user wants to load a Car or a Truck. Then it needs to ask if they want to add a Bookcase or Chair repeatedly until they choose to quit. If the piece doesn't fit, then delete it and keep loading.
After they quit, display the names of all of the furniture on the vehicle.
Notes: The Whole Point is you will have some kind of vehicle object, and in that object there will be a List of furniture pointers. Don't ever stick objects in Lists - that would make copies. We want to store pointers to the actual item we loaded.
Do not think "A car can't load Bookcases". It is "a car can't load heavy things". You don't want to hardcode anything about bookcases. Next week you may add beds to this program. If cars explicitly checked for bookcases, it would be crushed under a bed.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
