CECS 282
LAB ASSIGNMENT 1
Assigned date: 8/26
Due date: 9/3
30 points
Problem 1 [5 points]
Write a program that displays the sum of all odd digits of an input.
Problem 2 [5 points]
Write a program that displays the factors of a specified integer.
Problem 3 [20 points]
The Weather Service Bureau department has data representing monthly rainfall for a year and we would like to create a table categorizing each month as rainy (rainfall 20% higher than average) dry (rainfall 25% lower than average). or average. The data file for monthly rain fall is called rainfall.txt.
Output
The year's average monthly rainfall was 139 mm.
September has the highest rainfall (190 mm).
January has the lowes rainfall (95 mm)
Month Rainfall(mm) Classification
------- --------------- --------------
1 95 Dry
2 100 Dry
3 120 Average
4 130 Average
5 135 Average
6 145 Average
7 155 Average
8 185 Rainy
9 190 Rainy
10 160 Average
11 130 Average
12 120 Average
Program Requirements:
Implement the following functions in the program:
Hint:
Read data from a file.
GRADING