Basic_JavaScript

This project contain 6 basic JS problems to solve. The problems are listed before:

Write a program called SumOfTwoDice that prints the sum of two random integers between 1 and 6 (such as you might get when rolling dice).


Write a program called LeapYear which takes an argument N year (>= 1582) and tests if it is a leap year or not.


Write a program UniformRandomNumbers that prints five uniform random values between 0 and 1, their average value, their minimum value and maximum value.


In 1963 Samuel Pepys asked Isaac Newton which is more likely: getting 1 at least once when rolling a fair die six times or getting 1 at least twice when rolling it 12 times. Write a program PepysProblem that could have provided Newton with a quick answer.


Write a code fragment that reverses the order of a one-dimensional array a[] of double values. Do not create another array to hold the result.


Read in a sequence of words (*.txt file), separated by whitespace. Compute the number of times each word appears, and print, sorted by frequency.