Question
1) Suppose that the input is 7. Consider the following code. Scanner console = new Scanner(System.in); int alpha = 8; int beta = console.nextInt(); switch
1) Suppose that the input is 7. Consider the following code.
Scanner console = new Scanner(System.in);
int alpha = 8;
int beta = console.nextInt();
switch ( beta )
{
case 5: alpha = alpha + 1;
case 6: alpha = alpha + 2;
case 7: alpha = alpha + 3;
default: alpha = alpha + 5;
}
System.out.print(alpha);
What is the output of the following code?
Group of answer choices
a. 7
b. 16
c. 10
d. 13
e, 6
2) Assume the following code:
String team = "Seminoles";
System.out.println( team.length() + " " + team.substring(1,4));
What is the result of the above code?
Group of answer choices
9 emi
8 Seminole
8 Semi
8 Sem
9 emin
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started