Question: What is the error in the following code? Check all that apply. System.out.println(Enter your age:); age = input.nextInt(); System.out.println(Enter your major:); major = input. nextline();



What is the error in the following code? Check all that apply. System.out.println("Enter your age:"); age = input.nextInt(); System.out.println("Enter your major:"); major = input. nextline(); if (age == 18) System.out.println(" 18 is the age you can start voting!"); \} if (major == "ics") System.out.println("Obviously you're cool :)"); \} A. Not reading in user input correctly B. Not correctly evaluating major C. Needs to respond to user putting a different major than ics, otherwise program will crash D. None of these options are correct. / There are no errors. E. Needs to respond to user putting a different number than 18 , otherwise program will crash F. Not correctly evaluating age What type of values can a switch expression evaluate? A. int B. double C. boolean D. String E. char What can be found in the following code? Check all that apply) A. nested if or if-else statement B. multi-way if-else statement C. switch statement D. logical operator E. boolean operator F. boolean expression
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
