-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathJavaScript_1
More file actions
12 lines (8 loc) · 1.09 KB
/
JavaScript_1
File metadata and controls
12 lines (8 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
VERY EASY: Create two variables and assign a number to each. Console log the difference between the numbers.
Example output: “The difference between 6 and 2 is 4”
EASY: Create two variables and assign a person’s name to each. Console log a statement that says which name is shorter or longer, and by how many characters.
Example output: “The name Thomas is longer than John by 2 characters”
MEDIUM: Write a program to tell if someone is shouting (typing in all caps), whispering (typing in all lowercase), or neither. Use prompt to get user input, and then console log whether the user was shouting, whispering, or talking normally.
HARD: Create 4 math functions, one called add() that adds 2 numbers, one called subtract() that subtracts 2 numbers, one called multiply() to multiply 2 numbers, and one called divide() to divide two numbers.
VERY HARD: Create a simple calculator that prompts the user for a number, an operator (either +, -, * or /) and another number, and then uses the functions created in the hard challenge to output the value in sentence form.
Example output: "3 + 4 = 7"