Question: Using Python 3.5 or later wirte the following program, and include comments for what is being done so better understanding of the program. I am
Using Python 3.5 or later wirte the following program, and include comments for what is being done so better understanding of the program. I am quite stuck on this program.
Write a class called Hamburger, the program should ask the user the following question: 1. How would you like your burger cooked? (Rare, Medium Rare, Medium, Well Done) (String)
2. Would you like cheese on your burger? (Yes or No) (This is a boolean, True or False)
3. What toppings would you like? (Onions, Cucumbers, Mayo) (String)
The Hamburger class should have the following PRIVATE fields;
cookLevel a String which stores how well the burger is cooked i.e., rare, medium, well done, etc.
weight A int storing the weight of the hamburger meat, in ounces.
cheese a boolean indicating whether the burger has cheese or not.
toppings a list of Strings storing the toppings on the burger - ketchup, lettuce, tomato, onions, mayonnaise and pickles.
The Hamburger class should have the following methods:
A constructor.
Getter and setter methods for each of the fields.
Bite method the bite methods should reduce the weight of the burger by 1 ounce each time its called, until the weight is 0.
__str__ method.
In the same file, write a main function to test the functionality of the Hamburger class.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
