Question: formular: potential energy = mass x height x acceleration due togravity kinetic energy = mass x velocity^2/2 using java language 2. You have been contacted

formular: potential energy = mass x height x acceleration due togravity kinetic energy = mass x velocity^2/2
using java language
2. You have been contacted by a science teacher to design a program to calculate either the kinetic energy or potential energy of a body to be used by his students to verify their calculated results. The program should ask the user to enter 1 to calculate potential energy or 2 to calculate the kinetic energy. Base on the option entered, your program should ask the user to enter the necessary inputs and display the result. program should ask the user to enter a character to calculate another or to exit the Your program. Program Design ENERGY CALCULATOR Enter 1 for potential energy or 2 for kinetic energy calculation > 1 Enter the mass of the body> 15 Enter the height of the body > 2 Enter the acceleration due to gravity > 9.8 Potential energy = 294.00J Enter e to exit or c to continue> c Enter 1 for potential energy or 2 for kinetic energy calculation > 2 Enter the mass of the body > 20 Enter the velocity of the body> 5 Kinetic energy = 250.00J Enter e to exit or c to continue > e
Step by Step Solution
3.48 Rating (145 Votes )
There are 3 Steps involved in it
program in Java that calculates potential energy and kinetic energy based on user input java import ... View full answer
Get step-by-step solutions from verified subject matter experts
