Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the following switch statement, what will be printed? string s - new string ( cat): switch (5) f case nc I system,out. printIn( the

image text in transcribed

In the following switch statement, what will be printed? string s - new string ( "cat"): switch (5) f case nc I system,out. printIn(" the word has a ie. in it"): breaic; Syston,out. printlo("The word is cat"); becale: System,out. printlnt the word begins wtth o and ands with t"l; breaie; Systan.aut.print 2n ("I don't know that word"); break: A. The word is cat B. I den't know that vined C. The word bogins with c and ends with t D. There is a syntax error in this code. E. the word has a c in it i) Review CCheck to review before finishing (will be flagged in Table of Contents) Question 2 of 4 (worth 3 points) Given the following switch statement, what value will be printed? A. 12 B. 9 C. 8 D. 11 E. 10 (1) Review Check to review before finishing (will be flagged in Table of Contents) Question 3 of 4 (worth 3 points) The break statement does which of the following? A. ends the program B. transfers control out of the current control structure such as a switch statement C. ends the current line of output, returning the cursor D. denotes the ending of a switch statement. E. indicates the end of line when using System.out.print B) Review Check to review before finishing (will be flagged in Table of Contents) Question 4 of 4 tworth 3 points) Any comparison that can be implemented using if or if-else statements can be done with switch statements. A. true B. false

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

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions