Javascript Practice Problems

Navigation:

----------First Excersise----------

Problem Statement

Write a program that addresses the person when they enter their name.

Plans and pseudocode

Ask user to input their name into the text box
Output = "Hello " + name + ". Hope you like my website!";

Demonstration


----------Second Excersise----------

Problem Statement

Write a program where the viewer inputs a year and the program outputs the next twenty leap years

Plans and pseudocode

Ask user to input a year.
After that the year is then loaded into the function get().
While in the function runs it then finds the then next year that is divisible by four without a remainder.
It does this twenty times and then displays them.

Demonstration


----------Third Excersise----------

Problem Statement

Write a program that shifts every character in a phrase by three.

Plans and pseudocode

Ask the user to input a phrase to go through the cypher.
That phrase is then run one characte at a time through the function, shift().
Inside of the shift function, each individual character is adjusted depending on its unicode value.
If the values are between 65 and 87 or between 97 and 119, three is added to the value.
If the values are between 88 and 90 or between 120 and 122, twenty three is subtracted from the value
If the value doesn't fall into any of those ranges, the unicode is not changed and the character is not altered
The for loop runs until it completes the loop for the last character in the phrase.

Demonstration