Make sure each program has at least one method in addition to its drivermethod(main). Or use one driver main method and write method(s) for eachof the program.
It is a single program not two individual questions so please write both.
Write a java program to compute each of the following, use a separate method for each.(i) Calculate the energy of a flight traveling at the speed of light, use e = mc2take c as thespeed (3*108), e = energy and m is mass of the flight. Prompt the user to enter themass.(ii) Calculate the size of the gravitational force acting between you and your friend as youapproach each other (center-to-center 1 meter apart) in the hall way. Use the formulabelow. Prompt the user to supply the values of M and m.? = (?∗?∗m)/d2M = Mass of your friendm = Your massd = center-to-center distance 1mG = 6.67 * 10-11
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here