Problem #2 (20 points for pseudocode)
You are working for the weather channel and you have to write a program that will generate the average temperature for the last 7 days. A modular code is preferred, but a non-modular code is OK. (Provide the pseudocode)
Start
Declare variable temperature as double
Declare variable temperatureSum as double=0
Declare variable averageTemperature as double
for t =1 to 7 do
Prompt the user to enter a temperature
Read a temperature from the user
Set temperatureSum to temperatureSum + temperature
end for
averageTemperature = temperatureSum / 7
Display "The average temperature for the last 7 days: "+averageTemperature
Stop
Comments
Leave a comment