5.14 Programming Exercises

I l @ ve RuBoard

Exercise 5-1: Write a program that converts Celsius to Fahrenheit. The formula is

F = 9 / 5 C + 32.

Exercise 5-2: Write a program to calculate the volume of a sphere,

4 / 3 figs/u03c0.gif r 3 .

Exercise 5-3: Write a program to print out the perimeter of a rectangle given its height and width.

perimeter = 2 (width + height)

Exercise 5-4: Write a program that converts kilometers per hour to miles per hour .

miles = ( kilometers 0.6213712)

Exercise 5-5: Write a program that takes hours and minutes as input and outputs the total number of minutes (e.g., 1 hour 30 minutes = 90 minutes).

Exercise 5-6: Write a program that takes an integer as the number of minutes and outputs the total hours and minutes (e.g., 90 minutes = 1 hour 30 minutes).

I l @ ve RuBoard


Practical C++ Programming
Practical C Programming, 3rd Edition
ISBN: 1565923065
EAN: 2147483647
Year: 2003
Pages: 364

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net