Answered step by step
Verified Expert Solution
Link Copied!

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 x(amount of spring compression).
The program should prompt the user to enter the height in meters (m), mass of the crate in kilograms (kg), and the spring constant value (Nm). The height and mass should be greater than 0. The spring constant, k, should be an integer, should be greater than 0, and should be no more than 2,500 because a higher k 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: mgh=12kx2
Where
h=y plus the distance the spring is compressed.
g= gravity (9.81)
As example with height of 5m(y) and mass of 4kg(m) :
mg(y+x)=12(k)x2
12kx2-4gx-20g=0(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 x. The output should be two values. As an example, "The amount of spring compression, x, is 0.705 meters and -4.326 meters".
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago