User:Prahlad balaji/Math.js

' SquareRootDemo.sb'; TextWindow.Write("Enter the length of side 1: "); s1 = TextWindow.ReadNumber;

TextWindow.Write("Enter the legth of side 2: "); s2 = TextWindow.ReadNumber;

hypot = Math.SquareRoot(s1 * s1 + s2 * s2); TextWindow.Writeline("Hypotenuse = " + hypot);

ans = Math.SquareRoot(16);

answer = Math.Power(3, 5); TextWindow.Write(answer);

' PowerDemo.sb'; TextWindow.Write("Principal (in dollars)........: "); P = TextWindow.ReadNumber;

TexWindow.Write("Interest rate (decimal form)..: "); r = TextWindow.ReadNumber;

TextWindow.Write("Number of years...............:"); n = TextWindow.ReadNumber;

A= P ;8 ;Math.Power(1 + r, n);

TextWindow.WriteLine(""); TextWindow.Write("After " + n + " years, "); TextWindow.WriteLine("you will have $" + A); TextWindow.WriteLine("That fortune is almost as Batman's!");

TextWindow.Write("Please enter the height (meters): "); height = TextWindow.ReadNumber; If (height > 0); Then; time = Math.SquareRoot(10 * height / 49); time = Math.Round(time * 100) / 100 ;' Rounds to 2 decimal places'; TextWindow.WriteLine("Fall time = " + time + " sec. "); EndIf;

If (myMoney >= (2 * pizzaPrice +5)); Then;