Exam 3
- Date: Nov 6
- Open Notes, Computer is allowed
- NO CELL PHONES
Part 1 - Trace the program - 20 points
Program to Trace
Part 2 (80 points)
Write a function, weather , that has one parameter - num_days -
number of
days. The function reads temperature for each day and rain/no rain
indicator for each day. (0 - NO RAIN, 1 0 RAIN).
The function returns the number of days with WARM (75 and above
Fahrenheit) temperature and NO RAIN
Write main that reads the number of days to process, calls function
weather to find the number of WARM NO RAIN days. If there are NO warm days
without rain, the program prints appropriate message.
You can randomly generate your data instead of the user input
Bonus: Function also finds the average temperature for ALL RAIN DAYS
and average temperature for ALL NO RAIN DAYS.