Assignment D
Chapter 3 Problem 28
Hint: Use a cast.
Test data, run the program twice:
First test input 3.14159
Second test input 39.37
Chapter 3 Problem 33
Hint: In all problems, use memory constants, rather than defined constants or literal constants, whenever possible.
Test data, run the program three times:
First test input 98.6 degrees Fahrenheit
Second test input -40 degrees Fahrenheit
Third test input 32 degrees Fahrenheit
Problem D1
In classical physics:
momentum is mass times velocity
kinetic energy is one half the mass times the square of the velocity
Write a program that prompts the user for the mass and the velocity as input.
The program then computes the momentum and kinetic energy.
Finally, the program prints the momentum and the kinetic energy with identifying text.
Test data, run the program twice:
First test input 4.0 kilograms and 5.0 meters per second
Second test input 4.0 kilograms and 50.0 meters per second