in Education by
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…. Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Sample Java Program: switch(code) { case ‘B’ : System. out. println(“Businessman”); break; case ‘F’ : System. out. println(“Fighter”); break; case ‘E’ : System. out. println(“Employee”); break; case ‘I’ : System. out. println(“Intelligent”); break; case ‘b’ : System. out. println(“Businessman”); break; case ‘f’ : System. out. println(“Fighter”); break; case ‘e’ : System. out. println(“Employee”); break; case ‘i’ : System. out. println(“Intelligent”); break; default : System. out. println(“Brainliac”); } Output: Choose an alphabet: e Employee. Hope it helps!

Related questions

0 votes
    rewrite the following code in Python after removing all the syntax error underline is correction done in code a,b=2 ... print( end') Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    rewrite the following code in Python after removing all the syntax error underline is correction done in code a,b=2 ... print( end') Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    Q 5 Rewrite the following code in python after removing all the syntax errors. Underline each correction done in ... a logical operator Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    8. Rewrite the following using ternary operator. (a) if (bill>10000) discount=bill*10.0/100; else discount=bill*5.0/100; Select the correct answer from above options...
asked Nov 30, 2021 in Education by JackTerrance
0 votes
    3. The given HTML code have some syntax error rewrite the code Page Tititle This is the para tag cols Punjab ... for scroll the text Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    Write a program in 8086 to move hundred bytes of data from the offset address 3000H in the segment 4000H Select the correct answer from above options...
asked Dec 20, 2021 in Education by JackTerrance
0 votes
    a. What is abstraction? How it is different from inheritance? b.Differentiate between compiler and interpreter. c. ... final keyword. Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
0 votes
    a. What is abstraction? How it is different from inheritance? b.Differentiate between compiler and interpreter. c. ... final keyword. Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    Q.32 :-What will the SWAP macro in the following program be expanded to on preprocessing? will the code compile? ... y); return 0; Select the correct answer from above options...
asked Nov 30, 2021 in Education by JackTerrance
0 votes
    write an if statement program in java to find the smallest of three given integers using min() method of the Math ... I will report. Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    a. State the number of bytes occupied by char and int data types. b. Differentiate between = and == ... implicit type conversion. Select the correct answer from above options...
asked Dec 6, 2021 in Education by JackTerrance
0 votes
    a. State the number of bytes occupied by char and int data types. b. Differentiate between = and == ... implicit type conversion. Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
...