Computer Science, asked by ritensingh50, 8 months ago

Rewrite the following using switch-case construct: -

if (value ==1)

{

salary+=20000;

else if (value==2)

salary+=15000;

else if (value==3)

salary+=10000;

else

System.out.println(“Above Range”);

}​

Answers

Answered by Oreki
4

Switch Case:

switch (value) {

case 1:

salary += 20000;

break;

case 2:

salary += 15000;

break;

case 3:

salary += 10000;

break;

default :

System.out.println("Above Range");

}

Answered by princebopche1
1

Explanation:

Switch Case:

switch (value) {

case 1:

salary += 20000;

break;

case 2:

salary += 15000;

break;

case 3:

salary += 10000;

break;

default :

System.out.println("Above Range");

}

Similar questions