Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program Requirements Using the conservation of energy, an engineer needs to determine how much a spring is compressed to determine the effectiveness of the spring.
Program Requirements
Using the conservation of energy, an engineer needs to determine how much a spring is compressed to determine the effectiveness of the spring. Assuming a crate with a varying mass is dropped from a specified height, determine the value of amount of spring compression
The program should prompt the user to enter the height in meters mass of the crate in kilograms and the spring constant value The height and mass should be greater than The spring constant, should be an integer, should be greater than and should be no more than because a higher value would mean a higher cost. If the value entered does not meet these requirements, then the program should display the message "Invalid input" and the program should end.
Conservation of energy equation:
Where
plus the distance the spring is compressed.
gravity
As example with height of and mass of :
solving the equation results in a quadratic equation Since the values of height and mass will vary, the values in the quadratic equation will change.
To assist in the engineering analysis of the other parameters, write a Java program to solve for the value of The output should be two values. As an example, "The amount of spring compression, is meters and meters".
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started