1.
Grade Calculator
Write a JavaScript program that takes a student's score (out of 100) as input and
determines their grade based on the following conditions:
90 and above → "Grade: A"
80 to 89 → "Grade: B"
70 to 79 → "Grade: C"
60 to 69 → "Grade: D"
Below 60 → "Grade: F"
Use a function calculateGrade(score) to determine the grade.
Declare and initialize a variable to store the input score.
Use comparison operators (>=, <) and conditional statements (if-else).
2, Even or Odd Checker
Write a JavaScript program that takes a number as input and checks whether it is even or
odd.
Declare and initialize a variable for the input number.
Use a function checkEvenOdd(num) to determine if the number is even or odd.
Use the modulus operator % to check divisibility by 2.
Print "Even Number" if divisible by 2, otherwise print "Odd Number".
3. Simple Calculator
Write a JavaScript program that takes two numbers and an operator (+, -, *, /) as input,
then performs the corresponding operation.
Declare and initialize three variables: two numbers and an operator.
Use a function calculate(num1, num2, operator) that:
o Adds the numbers if the operator is "+"
o Subtracts the numbers if the operator is "-"
o Multiplies the numbers if the operator is "*"
o Divides the numbers if the operator is "/"
o Displays "Invalid operator" for any other input
Use conditional statements (if-else).
Use arithmetic operators (+, -, *, /).
4. Find the Largest Number
Write a JavaScript program that takes three numbers and determines the largest one.
Declare and initialize three variables for the input numbers.
Use a function findLargest(num1, num2, num3).
Use comparison operators (>) and conditional statements (if-else).
Print the largest number.