Pseudocode
Pseudocode
Pseudocode
Variables Used:
Start
number_1
number_2
larger_number
smaller_number
Accept number_1
Accept_number_2
number_2 = smaller_number
number_1 = smaller_number
Flowchart
22
Pseudocode
Start
Variables Used:
pincode = 340023
input_pin
Accept input_pin
If input_pin != pincode
End
Flowchart
23
Pseudocode
Start
Variables Used:
number
positive_number
negative_number
If number >= 1
End
Flowchart
24
Pseudocode
Start
Variables Used:
number
input number
switch number
Case 0:
Display “Zero”
Case 1:
Display “One”
Case 2:
Display “Two”
Case 3:
Display “Three”
Case 4:
Display “Four”
Case 5:
Display “Five”
Case 6:
Display “Six”
Case 7:
Display “Seven”
Case 8:
Display “Eight”
Case 9:
Display “Nine”
Case 10:
Display “Ten”
Default
End switch
End
Flowchart
25
Pseudocode
Start
Variables Used:
num_hours
wage
gross_pay
Display “ ==============================”
Display “ ==============================”
Display “ ==============================”
Input num_hours
Input wage
End
Flowchart
26
Pseudocode
Start
Variables Used:
Color
Mode
Red
Blue
Steady
Flashy
Accept Color
Then
Then
If Mode = Steady
Then
Then
End
Flowchart
27
Pseudocode
Start
Variables Used:
Equipment
Day_Type
Half_Day
Full_Day
Deposit = 300
Total
Rug_Cleaner, Lawn_Mower, Paint_Sprayer
Input Equipment
Input Day_Type
H_Rug = 160
F_Rug = 240
Input Day_Type
If Day_Type = H_Rug
Display “php:”Total
Display: “php:”Total
H_Lawn = 120
F_Lawn = 180
If Equipment = Lawn_Mower
If Day_Type = H_Lawn
Display “php:”Total
Display: “php:”Total
H_Paint = 200
F_ Paint = 300
If Equipment = Paint_Sprayer
If Day_Type = H_ Paint
Display “php:”Total
End
Flowchart
28
Pseudocode
Start
Variables used: weight, height, bmi, customerName, thin, healthy, overweight, obese, bmiValue
Display “customerName”
Accept customerName
Accept height
End
Flowchart
29
Start
Variables
Proverb
correct_answers
Proverb = ["The squeaky wheel gets the grease.", "Cry and you cry alone.", "Opposites attract.",
"Spare the rod and spoil the child.", "Actions speak louder than words.",
correct_answers = 0
proverb_value
Display proverb
Accept truth_values
truth_values = proverb
increment correct_answers
Display = "Continue"
if correct_answers is equal to 7:
Display = "Perfect"
Display = "Excellent"
End
30
Start
Variables Used:
year
month
days
Input Year
Then = True
Else:
Then = False
Then return = 31
Then return = 30
Else IF month == 2:
If is_leap_year(year):
Then Return = 29
Else
Then Return = 2
Input month
Input year
Else
Days = month, 0
If days != -1:
Else
End