You are on page 1of 3

History: Computers, Hardware Devices, and Programming Computing Principles for Programmers

Click or tap here to enter text.Click or tap here to enter text. Click or tap here to enter
text.@mySeneca.ca
Click or tap here to enter text.

Paste the question you've selected here


Make a sandwich for you (hint: Google video search for “algorithm sandwich”)
followed by your answer.
(minimum 250 words unless the first answer was more than 500 words)
1. Start.
2. Put gloves on.
3. Prepare the ingredients for sandwiches. (Bread, Butter, Jelly, Cheese)
4. Open the bread bag.
5. Pull out 2 slices of bread and put them on a paper plate.
6. Choose cold or toasted.
A. Cold: go to step 7.
B. Toasted: Go to the toaster, go to step 8.
7. Choose the sliced cheese to put in the sandwich.
A. Yes: Cover the sliced cheese on sliced bread.
B. No: Skip this step and then go to step 9.
8. Warm up the bread then go to step 9.
9. Choose the peanut butter.
A. Yes: Open the peanut butter jar, go to step 10.
B. No: Skip this step and go to step 12.
10.Using one of the spoons, scoop out two tablespoons of the peanut butter.
11.Spread the peanut butter only on one white side of the sliced bread
12.Choose the jelly to put in the sandwich.
A. Yes: Open a jar of jelly, go to step 13.
B. No: Skip this step and go to step 14.
13. Using the other spoon, scoop out two tablespoons of the jelly.
14.Spread the jelly only on one white side of the remaining sliced bread.
15.Put the two slices of bread together with the peanut butter side facing the jelly,
the peanut butter and the jelly come together.
16.Do you want to enjoy right away?
A. Yes: You can eat. Go to step 17.
B. No: Pack the paper. And eat later, go to step 17.
17.Enjoy
18.End

Fall 2021 Page 1|3


History: Computers, Hardware Devices, and Programming Computing Principles for Programmers

OR

Select a dress shirt from the closet, put it on, and button it up.
followed by your answer.
(minimum 250 words)
1. Start
2. Open the Closet door.
3. Robot checks the dress shirts in the closet.
A. There are no dress shirts in the closet.
i. Close the closet door and go to another closet. And go to step 2.
ii. If there are no more closets, print an error message.
B. There are dress shirts in the closet, go to step 4.
4. Robot holds the dress shirt in his hand.
A. Checks a dress shirt if it is:
i. Yes: it is in the closet. Go to step 5.
ii. No: they don’t have any. Go to step 3, again.
5. Robot holds the shirt in his hand.
A. The dress shirt is folded.
i. Unfold the dress shirt and go to Step 6.
B. The dress shirt is in a package.
i. Unpack the dress shirt and go to Step 6.
6. Robot puts the dress shirt over his shoulder.
A. If it does not go over the shoulder,
i. Try step 6 again until the dress shirt goes over the shoulder.
B. If a robot already puts the dress shirt over the robot's shoulder, go to Step 7.
7. Decide which sleeve the robot will put its arm through first.
A. When the robot puts the left arm into the left sleeve first, then it's right arm
goes into its right sleeve. Go to step 8.
B. When the robot puts its right arm into its right sleeve first, then its left arm
goes into its left sleeve. Go to step 8.
8. Make a dress shirt flat and have buttons on the front.
9. Close the shirt buttons.
A. When the robot closes the shirt button from the top, it then closes all the
buttons down from the top. Go to step 10.
B. When the robot closes the shirt buttons from the bottom, it then closes all
the buttons to the top starting from the bottom, go to Step 10.

Fall 2021 Page 2|3


History: Computers, Hardware Devices, and Programming Computing Principles for Programmers

C. If the Robot does not button the buttons, go to Step 8.


10. Make sure a dress shirt is properly buttoned.
A. Yes: Well, done. Go to step 11.
B. No: Go to step 9.
11. The end.

Fall 2021 Page 3|3

You might also like