It is late at night, and I decide to get a glass of milk before bed. Try to writ
ID: 3753949 • Letter: I
Question
- It is late at night, and I decide to get a glass of milk before bed. Try to write pseudocode describing the process of going to the kitchen and getting the milk. Be very specific and make sure you have all actions in the correct sequence. For example, remember you must open the refrigerator door before you reach in to retrieve the milk container. What if there is no glass in the cupboard? Did you check whether the glass was right side up before you started pouring? Now consider how many small decisions you make every day, and consider how involved it would be to write a program to instruct a robot to do the things you do in a day!
- It is late at night, and I decide to get a glass of milk before bed. Try to write pseudocode describing the process of going to the kitchen and getting the milk. Be very specific and make sure you have all actions in the correct sequence. For example, remember you must open the refrigerator door before you reach in to retrieve the milk container. What if there is no glass in the cupboard? Did you check whether the glass was right side up before you started pouring? Now consider how many small decisions you make every day, and consider how involved it would be to write a program to instruct a robot to do the things you do in a day!
Explanation / Answer
First get out of the bed. Wear your slippers. Don't go bare foot. Switch on the lights. Navigate to the kitchen. Open the Freezer in the kitchen. Take out the milk container. Check if there is a glass in the cupboard. If there is not clean glass, then go to the sink and wash the glass. Put the glass and place it on a table. Check if the glass is dry and right side up. Open the milk container. Pour milk into the glass. Make sure that the milk doesn't overflow. Drink the milk. Put the glass in the sink.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.