Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using c++ CAR VENDING MACHINE DESCRIPTION Disclaimers first, this is not based on any special type of car vending machine nor exactly describes how one
using c++
CAR VENDING MACHINE DESCRIPTION Disclaimers first, this is not based on any special type of car vending machine nor exactly describes how one works, this is our implementation on how we can get one to work for us. Ok, now that we got the legal stuff out of the way, let's describe how our Cheap-o Car Vendi Machine (C-OVM) is going to work. Our C-OVM is going to work the following way: . The machine has 1 ready to go spot, and 10 spots for storage. You can have a maximum of 10 cars in the machine at any given time, and 1 in the Ready-To-Go Spot (RTGS). o if you have 10 cars in the machine, you cannot add anymore, even if the RTGS open. 6 A car cannot be purchased until the RTGS is open. Every time we add a new car to the machine, we do it from the bottom floor. The RTGS is freed when the car is picked up For each car we hold the following information: Brand o Model Year Price . When a car is purchased, it is moved from the current spot in the machine to the RTGS There are no returns, remember: cheap-o is our motto. Once a car is purchased, it ha to be picked up. No putting the car back into the stack. The machine can be empty and have one car in the RTGS. . The machine is going to be managed by a class called COVM Class. This class, will have the attributes and functions to deal with the following attributes and operations: Attributes: list_cars: This is a linked list of cars in the machine rgts_car: This is the car that is sold and it's ready to go ( this car cannot exist in this spc and the list_cars list) total sales: this is a total value of the cars that have been sold using this machine. Every time a car is sold, the value of the car needs to be added to this attribute. Operations: 1) print_machine_status (20%) : displays to the screen the current status of the machine (each car information), how many cars in the machine, total sales so far, and whether there is a car in the RTGS. 2) add. car( 20%): adds a new car to the machine following the conditions described before. Since we are a cheap-o company, we always add cars at the bottom, that way we don't use too much power lifting the car to the top of the stack of cars. 3) purchase_car 20%): buys a new car moving it to the RTGS, and updating the machine. 4) release_car( 20%): the car in the RTGS is picked up by a lucky customer and the spot is freed. 5) value_status ( 20%): This prints the total value of all the cars currently in the machine don't include the RTGS) and also prints the total sales so far. 6) Extra Credit: a. Print all the cars in the stack equal or above certain year or price (12.5%) b. Find a car by brand or model (12.5%) Create a menu so that we can manage the machine, follow the operations described before to create your menu. Follow the coding guidelines we have been using so far. Classes and Structs: You must use a class to control the list, and you can use structs for stor information for the car. Dynamic Memory: You must use a linked list to control the cars in the list. Attributes: You can add any other attributes/operations that will be helpful to you. described in the breakdown must be part of the lab. NULL and Pointers: o Make pointers null before you use them. Always initialize your pointers. Comments Make sure that your code is documented (also that it has your name at t the file as mentioned in the notes) Make sure your functions are also well documented. Naming your File: Your file should be named as this example: ajerez_project2.cppStep 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