Question: Write and call a method which uses a switch statement to solve the following questions: Q 1 : Check if the user name contains the

Write and call a method which uses a switch statement to solve the following questions: Q1: Check if the user name contains the letter (r) or not. (the name is entered by the user). Q2: Determine whether a number entered by the user is odd or even. Q3: Check whether an entered number is a multiple of 5 or not. Q4: Compute the net salary of an employee based on the number of family members, as follows: (You have to input the basic salary and the number of family members) count 1 or 2: add 30 to the salary. count 3: add 45 to the salary. count 4 or 5: add 50 to the salary. otherwise: add 70 to the salary. Q5: Prompt the user to enter his/her name, and prints "your name is too short" if the length of the name is less than or equals 5 characters, otherwise, it prints "your name has more than 5 characters ".

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!