# A2a - /*program by Simon Wu and Emilie Courtemanche Simon...

This preview shows pages 1–2. Sign up to view the full content.

/*program by Simon Wu and Emilie Courtemanche Simon Wu 454 5302 Section O*/ S import apsc142.*; /* This program has the ability to take 2 coordinate points in a 2 dimension system, and calculate the distance between them. The specific points asked for by the questions is (2,3) and (8,-5).*/ public class A2a { public static void main (String[] args) { //Question 11 //Declare constants final double gravity=9.81; f //Declare variables double length; //length of pendulum in meters double period; //period of oscillating pendulum in seconds d // Prompt the user for the length of the pendulum System.out.print("Enter the length of the pendulum (in meters):"); length= StdIn.readDouble(); l //Perform calculations period= 2*Math.PI*Math.sqrt(length/gravity); p //Tell the user the value of the length and period of the pendulum System.out.println("length =" + length+ " meters"); System.out.println("The period of the pendulum is: " +period+ " seconds"); System.out.println(" "); System.out.println(" ");

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 12/01/2010 for the course APPLIED SC 142 taught by Professor Professorstansimmons during the Winter '10 term at Queens University.

### Page1 / 2

A2a - /*program by Simon Wu and Emilie Courtemanche Simon...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online