# All your functions are defined here
def serve(order):
if order == "plain":
plain()elif order == "blt":
blt()elif order == "lettuce wrap":
lettuce_wrap()elif order == "double":
double()elif order == "plain add muchroom":
plain_add_muchroom()elif order == "double add onion":
double_add_onion()
if __name__ == '__main__':
"double") # you may change the argument to the others serve(
Programming Project 2
Programming Projects are to be submitted to gradescope.
Due date: Friday, September 19, 2025 at 9pm
Credit for this programming project goes to Steven Truong, a former UGTA for CSC 110.
In this programming project you will implement a number of Python functions to print different types of burgers. Make sure you follow the provided style guide (you will be graded on it!). The only built-in function you can use is print()
. You are not allowed to use any other built-in method or function from any Python library.
Also make sure you check the Academic Integrity and Common Gradescope Errors pages.
Name the program burgers.py
. Make sure that gradescope gives you the points for passing the test cases.
Burger Restaurant
You are in-charge of a computer restaurant responsible for serving burgers to your customers. The restaurant menu only includes 6 types of burgers: plain, BLT, lettuce wrap, double, plain add mushroom, and double add onion. The order is taken as a string. For example, "plain add mushroom"
.
You will be given the ingredients as text symbols, and your task is to put them together to display the burgers using those symbols, and print the burger.
Ingredients
There are a total of 8 ingredients.
top bun
:
__________________________ / <> <> \ / <> <> <> <> \ \____________________________/
bottom bun
:
____________________________ / \ \____________________________/
patty
:
__________________________ | | |__________________________|
lettuce
:
\/^\/^\/^\/^\/^\/^\/^\/^\/^\ \/^\/^\/^\/^\/^\/^\/^\/^\/^\
tomato
:
()()()()()()()()()()()()()() | | ()()()()()()()()()()()()()()
bacon
:
~~~~~~/\~~~~~~/\~~~~~~/\~~~ ~~~~~~/\~~~~~~/\~~~~~~/\~~~
mushroom
:
| (o) (o) (o) (o) |
onion
:
| @@@ @@@ @@@ @@@ |
Development Strategy
The serve
function and the main
function are already provided as below:
You need to define your own functions to print the burger based on the order. For example, after running the code above, a double
burger should be displayed in the console. In the main
function, you can change the argument (e.g., “double”) in the serve
function to print other burgers.
You may also modify the code within the serve
function. However, please ensure that its sole argument, order
, is restricted to one of the following values: "plain"
, "blt"
, "lettuce wrap"
, "double"
, "plain add muchroom"
, and "double add onion"
.
Note: Points will be deducted if your code lacks proper decomposition. For example, placing all print statements in just one or two functions without breaking down the logic appropriately.
We can use logical expressions in if
and elif
statements to print different things from a function:
def is_positive(number):
if number > 0:
print("Number is positive")
elif number < 0:
print("Number is negative")
elif number == 0:
print("Number is zero")
def main():
10)
is_positive(0)
is_positive(-10)
is_positive(
main()
Number is positive
Number is zero
Number is negative