Employee name = John Robert
Start
Hours worked = 40
Display Enter Employee Name
Hourly Rate = $12.34/hour
Display Enter Hourly/Rate
hourlyRate = 12.34
Display Enter Hours Worked
hoursWorked = 40
Display Weekly pay amount
print(hourlyRate*hoursWorked)
Enter Another Employee?
Pseudocode:
Yes
Start
Display box – “Enter Name”
No
Display box – “Enter Rate”
Output “Thank you for entering your time”
Display box – “Enter Hours”
Show weekly pay amount.
End
Ask, enter next employee?
If yes, loop start.
If no, end process and show:
Thank you for entering your time
End loop.
Problem 2:
End
Car name = Ford
Display Enter vehicle Name
gas Amount = 20.43 gallons
miles Driven = 600
Display Enter miles Driven
gasAmount = (20.43)
milesDriven = (600)
Display Enter gas Amount
print (milesDriven/gasAmount)
Display Miles Per Gallon Total
Pseudocode:
Start
Enter Another Trip?
Display box – “Enter vehicle name”
Yes
Display box – “Enter miles Driven”
Display box – “Enter gas Amount”
No
Show miles per gallon Total.
Output “Thanks for using trip-buddy”
Ask, Enter another trip?
End
If yes, loop start over
If no, end the process and show:
“Thank you for using trip-buddy”
End Loop.
Reference
Dierbach, C. (2014). Python as a first programming language. Journal of Computing Sciences in Colleges, 29(3), 73-73.