Question: Java output 6. Convert the following if statement using a switch statemen if (weekday day Sunday else if (weekday 2) day Monday else if (weekday
6. Convert the following if statement using a switch statemen if (weekday day "Sunday else if (weekday 2) day "Monday else if (weekday 3) day "Tuesday else if (weekday4) else if (weekday5) else if (weekday 6) else if (weekday 7) day "Wednesday day- "Thursday day "Friday"; day "Saturday: else System.out printin Wrong number of years" 7. Use the Conditional Operator to find if a given number is positive, negative, or zero 8. What is the array of the following program public static void main/String args public class demo public static void main/Stringl) args) int[] array - (9,2,11,3,18,5,4,8,7,16) int i, sum-e um - Sum+ array[i)x 9 array[11-array[1] % 4; System.out.printin( Sum is sum): for (1 9; 1-8; 1) System.out.print(array[]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
