thetrueyounigga

Untitled

Dec 15th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. function start(){
  2. var operation = readLine("What operation do you want to use? ");
  3. if(operation == "circumference"){
  4. var radius = readLine("What is the radius? ");
  5. var circumference = (radius * radius) * 3.14;
  6. println("The circumference is " + circumference);
  7.  
  8. }else if(operation == "squareroot"){
  9. var number = readLine("Choose a number to square root. ");
  10. var sqrt = Math.sqrt(number);
  11. println("The square root of " + number + " is " + sqrt);
  12.  
  13. }else if(operation == "hypotenuse"){
  14. var leg1 = readInt("What is the first leg? ");
  15. var leg2 = readInt("What is the second leg? ");
  16. var hypotenuse = (leg1 * leg1) + leg2 * leg2;
  17. println("The hypotenuse is " + hypotenuse );
  18. }
  19. }
Add Comment
Please, Sign In to add comment