Modularisation Ex 5 - Highest Temperature

Created By: M Ritter | Difficulty Level: 4

Description

Write an algorithm which asks the user to enter the maximum temperature for seven days of a week. Call a function which finds and returns the highest temperature and the day on which it occurred.

Puzzle

Drag from here

  • IF temps[day] > maxTemp THEN
  • ENDFOR
  • FOR day in days
  • SET maxDay = 0
  • maxTemp = temps[day]
  • END maxTemp
  • maxDay = day
  • FOR day in days
  • SET temps = [ ]
  • DISPLAY Highest temperature was + maxTemp + on + maxDay
  • RETURN maxTemp, maxDay
  • NEXT day
  • END
  • NEXT day
  • APPEND temp to temps
  • SET days = [Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday]
  • INPUT temp
  • BEGIN
  • BEGIN maxTemp(temps)
  • ENDIF
  • SET maxTemp = temps[0]
  • SET maxDay, maxTemp = CALL maxTemp(temps)

Construct your solution here