Created
March 16, 2015 14:19
-
-
Save kenechiokolo/1835af58095124f27b9d to your computer and use it in GitHub Desktop.
CS106A: Assignment 2.4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File: PythagoreanTheorem.java | |
* Name: | |
* Section Leader: | |
* ----------------------------- | |
* This file is the starter file for the PythagoreanTheorem problem. | |
*/ | |
import acm.program.*; | |
public class PythagoreanTheorem extends ConsoleProgram { | |
public void run() { | |
println("Enter values to compute Pythagorean Theorem:"); | |
int a = readInt("a:"); | |
int b = readInt("b:"); | |
double c = Math.sqrt(((double) a)*((double) a) + ((double) b) * ((double) b)); | |
println("c = "+c+""); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment