Chapter 26-30: MATH METHODS
Write a program that takes a positive integer from user & display the following in your browser.
a. number
b. round off value of the number
c. floor value of the number
d. ceil value of the number
Write a program that takes a negative floating point number from user & display the following in your browser.
a. number
b. round off value of the number
c. floor value of the number
d. ceil value of the number
Write a program that displays the absolute value of a number. E.g. absolute value of -4 is 4 & absolute value of 5 is 5
Write a program that simulates a dice using random() method of JS Math class. Display the value of dice in your browser.:
Write a program that simulates a coin toss using random() method of JS Math class. Display the value of coin in your browser
Write a program that shows a random number between 1 and 100 in your browser.
Write a program that asks the user about his weight. Parse the user input and display his weight in your browser. Possible user inputs can be:
a. 50
b. 50kgs
c. 50.2kgs
d. 50.2kilograms
Write a program that stores a random secret number from 1 to 10 in a variable. Ask the user to input a number between 1 and 10. If the user input equals the secret number, congratulate the user.