Programming Project 2

Programming Projects are to be submitted to gradescope.

Due date: Friday, February 06, 2026 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:

# 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 mushroom":
       plain_add_mushroom()
    elif order == "double add onion":
       double_add_onion()

if __name__ == '__main__':
    serve("double") # you may change the argument to the others

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 mushroom", 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.

Before You Begin

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():
  is_positive(10)
  is_positive(0)
  is_positive(-10)
  
main()
Number is positive
Number is zero
Number is negative
What counts as advanced code

Students must complete programming projects using only the concepts and materials covered in class or assigned readings. Using external or advanced code beyond this scope is not permitted unless explicitly approved by the instructor or teaching assistants.

Both an autograder and manual review will be used to detect unauthorized advanced content. Deductions will be applied accordingly. In cases where these deductions result in a negative score, the project grade will be adjusted to zero. Otherwise, your Gradescope score will be your final grade.

Please note that you should wait for the autograder to display your score, as only the points reported by the autograder will be used as your grade.