Day 34: Wednesday March 30, 2022
Average of five values
C
CODING
start loop
repeat 5 times
input Number
end loop
display Result
calculate Result = Result + Number
calculate Result = Result/5
set Result = 0
1
2
3
Which one doesn’t belong?
Find a reason why each one does not belong.
Check Your Understanding: Mild 🔥
C
CODING
1
2
A code is written to determine a person is old enough to vote.
Drag the blocks below into their correct positions to the right to complete the code.
set age = input
Else display “You can’t vote yet.”
define age as a variable
If age >= 18 then display “You can vote.”
Check Your Understanding: Medium 🔥🔥
C
CODING
1
2
3
A code is written to determine if a person has stayed within their budget.
Drag the blocks below into their correct positions to the right to complete the code.
If pay >= spending then display “Great! You stayed within budget.”
set spending = input
Else display “Uh oh! You’ll need to use some savings to pay your bills. What can you change in your budget so it doesn’t happen again?”
set pay = input
Define pay and spending as variables
Check Your Understanding: Hot 🔥🔥🔥
C
CODING
1
2
3
A code is written to determine ______.
Drag the blocks below into their correct positions to the right to complete the code.
set food = input
set transportation = input
set shelter = input
set pay = input
Define food, transportation, shelter, pay and difference as variables
If difference >= 0 then display “Great! You stayed within budget for your primary needs. You have $<difference> left for savings and other expenses”
Calculate difference = pay - (food + transportation + shelter)
Else display “Uh oh! You spent $<-1*difference> beyond what you earned. You’ll need to use some savings to pay your bills. What can you change in your budget so it doesn’t happen again?”
4
Check Your Understanding: Answers
C
CODING
1
2
set age = input
If age >= 18 then display “You can vote.”
Mild 🔥
1
2
3
Else display “Uh oh! You’ll need to use some savings to pay your bills. What can you change in your budget so it doesn’t happen again?”
set pay = input
Define pay and spending as variables
Medium 🔥🔥
1
2
3
4
Define food, transportation, shelter, pay and difference as variables
If difference >= 0 then display “Great! You stayed within budget for your primary needs. You have $<difference> left for savings and other expenses”
Calculate difference = pay - (food + transportation + shelter)
Else display “Uh oh! You spent $<-1*difference> beyond what you earned. You’ll need to use some savings to pay your bills. What can you change in your budget so it doesn’t happen again?”
Hot 🔥🔥🔥
ANSWERS.
PRESENT this slide then CLICK 🠊 to REMOVE the black box.
Coding Intro: My Takeaways
C�CODING
Page 20
Possibility of what you could include:
I know how to order steps to create an algorithm to solve a problem.
C2.2�CODING
Day
34
What have you learned about this that you didn’t know before? | Include examples of how you have shown this learning. | |
Complete this in your Learning Log.