vendredi 12 juillet 2019

How to use && operator in the case of switch statement?

How to use && in the case of the switch? I want to convert this if-else into switch-case. Please help me I tried many options but didn't work any of them.

if( bpay <= 90000 &&  bpay >= 85000 )
{
System.out.println("You Job is General Manager");
}

if( bpay <= 84999 && bpay >= 75000 )
{
 System.out.println("Your Job is Manager" );
}

if ( bpay <= 74999 && bpay >= 65000 )
{
System.out.println("Your Job is Assistant Manager ");
}
if ( bpay <= 64999 && bpay >= 55000 )
{
System.out.println("Your Job is Accoutant");
}
if( bpay <= 54999 && bpay >= 40000 )
{
System.out.println("Your Job is Clerk");
}
if( bpay < 40000 )
System.out.println("You Job is Security Incharge");

Aucun commentaire:

Enregistrer un commentaire