Biology, asked by bangaru5, 11 months ago

Rewrite the following JAVA program segment using switch case..
char code;
if(code=='B'||code=='b')
System.out.println("Businessman");
if(code=='F'||code=='f')
System.out.println("Fighter");
if(code=='E'||code=='e')
System.out.println("Employee");
if (code=='I'||code=='i')
System.out.println("Intelligent");

plzzzz plzzz answer me fast i want this right now....plz help me...

Answers

Answered by devika1032
0
Switch(code)
{
case 'b': System.out.println("Businessman");break;
case 'B': System.out.println("Businessman");break;
case 'f': System.out.println("Fighter");break;
case 'F': System.out.println("Fighter");break;
case 'e': System.out.println("employee");break;
case 'E': System.out.println("employee");break;
case 'i': System.out.println("intelligent");break;
case 'I': System.out.println("intelligent");break;
default: System.out.println("error");
}
Similar questions