Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions

Question

How do we organise for international logistics?

Answered: 1 week ago