Next: About this document
Home Work 1: Data Types, Variables and Expressions
Note: Submit all your programs (i.e., exercises 2-4) both as a
hard copy and electronically using the ``handin'' command. Make sure
to use the appropriate project number assigned to the problem when
using the handin command. Otherwise, your homework solutions will be
stored in a wrong file and thus may be evaluated incorrectly.
- Determine the appropriate
variable type and names for the following. Give your justification
for choosing the variable type.
- a person's age to the nearest year
- a person's weight in pounds
- the radius of a circle
- the cost of an item
- the highest grade on a test (assume it is always 100)
- the temperature
- the distance from the Earth to a star in miles
- (Project 1) Exercise 4 in page 21 of your text.
- (Project 2) Write a program that reads in four test scores, computes the
average and displays the result.
- (Project 3) All of you are familiar with wind chill. There is an
excellent formula to calculate the wind chill, given the ambient
temperature in degrees Fahrenheit and the wind velocity in miles per
hour. The formula is reasonable accurate for wind speeds between 5 and
90 MPH, and ambient temperatures between -40 and +90
F.
Here is the formula:
c = ((10.45 + (6.686*sqrt(v))-(o.447*v))/22.034*(t-91.4))+91.4
Here the function ``sqrt'' computes the square root. Write a C program
to accept values for velocity and temperature to calculate the wind
chill, c and print ``given the temperature ``t
F,'' and the wind
velocity ``v,'' the wind chill is ....
Vijay &
Mon Feb 2 18:38:54 EST 1998