Question: Question 5 (a) Re-write the condition stated in Statement 3 using Switch statement instead of if else. char letter = 'C'; if(letter == 'A' ||

Question 5 (a) Re-write the condition stated in Statement 3 using Switch statement instead of if else. char letter = 'C'; if(letter == 'A' || letter == 'E') { System.out.println("This is an vowel."); } else if(letter == 'B' || letter == 'C' || letter 'D') System.out.println("This is a consonant."); } else if(letter == '@' || letter == '#') { System.out.println("This is a special character."); == Statement 3 (10 marks) (b) Write a java program to create an Array which accepts any number of integer values using Scanner method. Print the contents of the created array, then classify each element as either odd or even and print the result. (15 marks) Maula1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
