Exercises

1. Write a program to convert temperature measured in Fahrenheit to its equivalent temperature measured in the celsius scale. Note the coversion formula to be used is:
celsius = (5/9)*(fahrenheit - 32)
Your program must query the user for a fahrenheit value and then display the fahrenheit value and its equivalent celsius value.
2. Write a program that queries the user for two integer values, and then computes and displays their sum, their difference, their product, their quotient, and their average.
3. Write a program that queries the user for a floating point value (rational number), and then computes and displays its value rounded to the nearest integer value.
4. Write a program that queries the user for an integer value that represents the number of days elapsed, and computes and displays the equivalent number of years, months and days. Assume that a year is equivalent to 365 days, and a month is equivalent to 30 days.




Back to Previous Page

Document:
Local Date:
Last Modified On: