Assignments and GDBs
- Published on Thursday, 26 April 2012 15:44
- Written by Bonfire
CS201 Introduction to Programming Solution ( due Date 02.05.2012)
Problem Statement: Temperature Calculation system
Write a program that displays average, highest and lowest temperatures.
- The program will take temperature readings as input from user for specified number of consecutive days.
- Program will store these temperature values into an array.
- Then it will pass this array to three different functions.
- One function will return highest temperature, one will return lowest temperature and third one will return average temperature.
- All these functions will be called inside main() function where these temperature results will be displayed to the user.
Enter the number of consecutive days to read their temperature : 5
Enter temperature for day 1: 50
Enter temperature for day 2: 80
Enter temperature for day 3: 30
Enter temperature for day 4: 92
Enter temperature for day 5: 47
The average temperature is 59.80
The highest temperature is 92.00
The lowest temperature is 30.00