Question: Program Specification - Write a class named ComputeCompression that contains a main method. - There should be one .java file (i.e ComputeCompression.java) - Use a

 Program Specification - Write a class named ComputeCompression that contains amain method. - There should be one .java file (i.e ComputeCompression.java) -

Program Specification - Write a class named ComputeCompression that contains a main method. - There should be one .java file (i.e ComputeCompression.java) - Use a package named edu.ttc.egr281 Program Submission Create a ZIP file that contains only .java files (no .class files). The zip file must use the naming convention: A 2. zip Ex: SmithA2.zip Submit the ZIP file via D2L. Grading Style: Comments and Indentation Functionality: Complies, Runs, and Produces correct output The program will be evaluated using test cases developed by the instructor. Late assignments cannot be accepted. 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. Assume a crate is dropped from a height of y=5m, determine the value of x (amount of spring compression) if the crate has a mass of 4kg. The spring constant units are N/m. The program should prompt the user to enter a value for the spring constant (N/m). The spring constant, k, should be an integer and should not be 0 . It also should not be less than 0 . The value should be no more than 3,000 because a higher k value would mean a higher cost. If the value entered does not meet these requirements, then the program should display invalid input. Conservation of energy equation: mgh=1/2kx2 Where h=y plus the distance the spring is compressed. g=9.81 (gravity) mg(5+x)=1/2(k)x2 1/2kx24gx20g=0 (solving the equation results in a quadratic equation). 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!