WHILE LOOP PRACTICE
Program 1:
Write a program that first reads one integer.
If the integer is EVEN, the program reads 7 real numbers. Each number
indicates the
Fahrenheit temperature for one day. The program finds and prints the
average Celsius temperature for these 7 days.
Use the following
formula to
convert Fahrenheit to Celsius:
Celsius = (5/9)*(Fahrenheit-32)
If the integer is ODD, the program reads 7 real numbers. Each number
indicates the
Celsius temperature for one day. The program finds and prints the
average Fahrenheit temperature for these 7 days.
Use the following
formula to
convert Celsius to Fahrenheit:
Fahrenheit = (9/5)* Celsius + 32
Program 2:
Write a program that first reads one
positive integer that will indicate an amount of input integer number that
will
come after that.
The program will read the series of the integer numbers (amount of integer
numbers will be equal
to the first input number) and will find the amount of the even
numbers that are divisible by
4, their sum and their average.