notes/education/software development/ECE1400/Flowcharts and Pseudocode.md

40 lines
743 B
Markdown
Raw Normal View History

2024-08-31 18:08:50 +00:00
# Banana Cake
## Instructions
2024-08-31 18:03:50 +00:00
2024-08-31 18:08:50 +00:00
1. Assume an action set of {add \<ingredient>, stir, bake, cool}. Draw a flowchart, using the paradigm discussed in class, to show the process of baking a banana cake. Use Google to find a typical list of ingredients.
2. Represent the flowchart from problem 1 as pseudocode.
2024-08-31 18:03:50 +00:00
2024-08-31 18:08:50 +00:00
## Diagram
```d2
2024-08-31 18:33:50 +00:00
vars: {
d2-config: {
dark-theme-id: 200
2024-08-31 19:39:50 +00:00
layout-engine: elk
2024-08-31 18:33:50 +00:00
}
}
2024-08-31 18:58:50 +00:00
begin: {
shape: oval
2024-08-31 19:39:50 +00:00
# near: top-left
2024-08-31 18:58:50 +00:00
}
2024-08-31 19:44:50 +00:00
end: {
shape: oval
# near: bottom-right
}
2024-08-31 19:39:50 +00:00
# grid-rows: 20
grid-columns: 2
2024-08-31 18:18:50 +00:00
begin -> add 3c flour\
2024-08-31 18:23:50 +00:00
-> add 1 1/2 tsp baking soda\
-> add 1/2 tsp cinnamon\
-> add 1/2 tsp salt\
2024-08-31 19:39:50 +00:00
-> stir\
2024-08-31 18:38:50 +00:00
-> add 3 mashed bananas\
-> add 1 tsp lemon juice\
2024-08-31 19:39:50 +00:00
-> stir again\
2024-08-31 18:38:50 +00:00
-> add 3 eggs\
2024-08-31 19:03:52 +00:00
-> add 2tsp vanilla extract\
-> end
2024-08-31 19:44:50 +00:00
2024-08-31 18:08:50 +00:00
```