singhvishal404 / practicejs

0 stars 0 forks source link

Basic problems on switch case statement #5

Open adasarpan404 opened 9 months ago

adasarpan404 commented 9 months ago

Sure, here are some basic problems on switch case statements for practice:

  1. Calculator Program: Write a program that takes two numbers and an operator (+, -, *, /) as input from the user and performs the corresponding operation using a switch case statement.

  2. Weekday Name: Write a program that takes a number between 1 and 7 as input from the user and displays the corresponding weekday name (1 for Monday, 2 for Tuesday, ..., 7 for Sunday).

  3. Simple Menu System: Create a simple menu system with options such as:

    • Option 1: Display "Hello"
    • Option 2: Display "Goodbye"
    • Option 3: Display "Exit" Implement a switch case statement to execute the corresponding action based on the user's choice.
  4. Grade Conversion: Write a program that takes a numerical grade as input (0-100) and converts it to a letter grade using the following scale:

    • A: 90-100
    • B: 80-89
    • C: 70-79
    • D: 60-69
    • F: 0-59
  5. Simple ATM System: Create a simple ATM system with options such as:

    • Option 1: Check Balance
    • Option 2: Deposit
    • Option 3: Withdraw
    • Option 4: Exit Implement a switch case statement to perform the corresponding action based on the user's choice.