Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using Python 3.5 or later wirte the following program, and include comments for

ID: 3793563 • Letter: U

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 quite stuck on this program.

Write a class called Hamburger.

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 it’s called, until the weight is 0.

__str__ method.

In the same file, write a main function to test the functionality of the Hamburger class.

Explanation / Answer

Please find the code below

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote