Demo

Basic

  1. WAP to read 2 numbers and print addition of those two numbers
  2. WAP to read 2 numbers and print subtraction
  3. WAP to read 2 numbers and print multiplication
  4. WAP to read 2 numbers and print division
  5. WAP to read 2 numbers and print modulus (Remainder)
  6. WAP to read radius and print area and circumference of circle
  7. WAP to read length and breadth and print area and perimeter of rectangle

Conditional Statement (if else)

  1. WAP to read a number and check if its positive or negative
  2. WAP to read a number and check it is even or odd
  3. WAP to read 2 numbers and find greatest among them
  4. WAP to read 3 numbers and find greatest among them
  5. WAP to read marks of 5 subjects and check the student is pass or failed
    1. add validation for marks less than 0
    2. add validation for marks greater than 100

Loops

  1. WAP to print hello world 10 times with numbering
  2. WAP to print square of numbers from 1 to 10
  3. WAP to print numbers from 1 to given number
  4. WAP to print cube of numbers from 1 to given number
  5. WAP to read a number and print table of that number
  6. WAP to execute Fizz Buzz Problem / Print number 1 to 100
    1. if number is divisible by 3 then print Fizz
    2. if number is divisible by 5 then print Buzz
    3. if number is divisible by both 3 and 5 then print Fizz Buzz
  7. WAP to execute lift program of 20 floor
    1. print number with delay of 1 sec (use time module’s sleep method)
    2. skip 13 number
    3. break after printing 13
  8. WAP to create random jackpot number and take input from user to guess the number. Based on level the attempt to guess the number should change
    1. Easy – 20 attempts
    2. Medium – 10 attempts
    3. Difficult – 5 attempts

Array

  1. WAP to find average of on array
  2. WAP to find greatest number from an array
  3. WAP to count all EVEN and ODD numbers
  4. WAP to find sum, mean, min, max from array
  5. WAP to search a number in it
  6. WAP to sort it in ascending order

Array of JSON

const employees = [
{ id: 1, name: "Amit Sharma", department: "HR", salary: 35000 },
{ id: 2, name: "Priya Verma", department: "IT", salary: 50000 },
{ id: 3, name: "Ravi Kumar", department: "Finance", salary: 60000 },
{ id: 4, name: "Neha Singh", department: "IT", salary: 55000 },
{ id: 5, name: "Vikram Patel", department: "HR", salary: 40000 },
{ id: 6, name: "Anjali Mehta", department: "Marketing", salary: 45000 },
{ id: 7, name: "Suresh Reddy", department: "Finance", salary: 70000 },
{ id: 8, name: "Kiran Nair", department: "IT", salary: 48000 },
{ id: 9, name: "Pooja Joshi", department: "Marketing", salary: 42000 },
{ id: 10, name: "Arjun Desai", department: "Finance", salary: 65000 }
];
  1. Write a program to print all employee names.
  2. Write a program to find employees from the IT department.
  3. Write a program to find the employee with the highest salary.
  4. Write a program to calculate the total salary of all employees.
  5. Write a program to increase the salary of HR employees by 10%.
  6. Write a program to get all employees with a salary greater than 50,000.
  7. Write a program to sort employees by salary in ascending order.
  8. Write a program to find the average salary of employees in the Finance department.
  9. Write a program to find an employee by a given ID.
  10. Write a program to group employees by their department.