| |
This Lab reinforces the material in the lecture notes on
using variables, the Math package, formatted output, and user input.
- Write a program which prompts the user for the height,
width, and depth of a rectangular solid and computes and prints the
volume of the solid. The program should use
ints
to store the values.
- Write a program which asks the user for an annual salary
and tells them the equivalent hourly wage, based on working
forty hours per week for fifty weeks per year. You should use
doubles throughout the program. When you print the
hourly wage, do so with exactly two digits to the right of the decimal
(as you'd expect for monetary values).
- Write a program which asks the user for an angle in radians and tells them the value of
all three basic trig functions for that value.
- Write a program which asks the user for an angle in radians and then prints output
that will allow the user to confirm some of the basic trig identities (i.e. sin2 + cos2 = 1)
- Write a program which displays a random floating point value in the range between
0 and 1.
- Write a program which displays a random floating point value in the range between
0 and 10.
- Write a program which generates a random floating point value in the range between
0 and 2*pi and tells the user the value and the result of computing the three basic trig functions
on that value.
|