Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var math = {
- 1 : function() {
- var a = prompt("A: "), b = prompt("B: "), c = prompt("C: ")
- console.log (
- a == 0 && Math.sqrt(Math.pow(c, 2) - Math.pow(b, 2)) || b == 0 && Math.sqrt(Math.pow(c, 2) - Math.pow(a, 2)) ||
- c == 0 && Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2)) ||
- "error, invalid parameters"
- )
- }
- }
- while ("David is cooler than Grant") {
- math[parseInt(prompt(
- "1) Pythagorean Theorem\n" +
- "2) Other Thing To Determine"
- ))]()
- }
Advertisement
Add Comment
Please, Sign In to add comment