Home Segments Top Top Previous Next

126: Practice

The energy of a moving mass is given by the formula 1/2 mv2. Write a program that determines the ratio of energies of a car moving at two specified velocities. Write and use a method named square in your solution. Use your program to determine the ratio of energies for one car moving at 80 miles per hour and another moving at 55 miles per hour. Use numbers of type double throughout.