Question: Programming Assignment For your unit 1 assignment, you must first install the Netbeans development and the Java Software Development Kit and test the installation. Detailed
Programming Assignment
For your unit 1 assignment, you must first install the Netbeans development and the Java Software Development Kit and test the installation. Detailed instructions for doing this are provided in the unit overview. Students who are using the virtual computing lab will not be required to install the software as this has already been completed. Students who will be using mobile computing devices should consider creating a free account at www.programr.com and creating a Java project in which to complete this (and future) assignments.
In this assignment, you will create a program that computes the distance an object will fall in Earth's gravity.
1-Create a new class called GravityCalculator.
2-Copy and paste the following initial version:
import java.io.*;
public class GravityCalculator {
public static void main(String[] arguments){
double gravity =-9.81; // Earth's gravity in m/s^2
double initialVelocity = 0.0; // starting velocity of the object
double fallingTime = 10.0; // time in seconds that the object falls
double initialPosition = 1000.0; // Starting position in meters, the calculation will determine the ending position in meters
double finalPosition = 0.0;
System.out.println("The object's position after " + fallingTime +" seconds is "+finalPosition + " m.");
}
}
3-Run it
4-Modify the example program to compute the position of an object after falling for 10 seconds, outputting the position in meters. The formula in Math notation is:
x(t) = 0.5at^2 + vit + xi
Variable|Meaning|Value
a Acceleration (m/s2) -9.81
t Time (s) 10
vi Initial velocity (m/s) 0
xi Initial position 1000
Submit your GravityCalculator.java file along with the output you received when running it. The output should be captured as a screen capture or by cutting and pasting the output from the window that the output of your program is displayed in.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
