Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

they're all related parts What will be dieplayed by lines 2 and 3 if plane is assigned a valee of 2 in line 1? public

they're all related parts image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
What will be dieplayed by lines 2 and 3 if plane is assigned a valee of 2 in line 1? public class Ifs 85 witich f. public static void main(String D args). . 1 int plane = int bike =1, train =10 switch (plane) f. case i: bike m ? train =2; plane =3 break; case 2. bike = 3; tralin =3; case 3; blke m 4 ; train =4 break; default? bike =5 train =5; 1. System.out.printin("the answer is " bike = 3; train = 3; case 3; bike =4 train = 4; break; default: bike = 5; train =5 1 2 System.out.printin("the answer is " + (bike + train)); j A. The answer is A b The answer is 6 c. The answer is 11 a. The answer is 8 The answer is 10 public class ifs 8 witch \{ public static void main(String[] args) 4 int purple =1, white =1, orange =1; if (orange c=22 ) System.out.printin(-5eeya7); else if (purples 5) if (white =6 ) 5 System.out.println("Seeya"); 6 if(purple >1088 white 0) if(chair >1) System.out.printin("Up"); else if(chair cm 2 8 : (desk >1)) System.out.printin("Down"); else System.out.printin("Left"); else System.out.printin("Right"); 1 public class Ifs & witch private static int desk = private static int chair = public static void main(String[] args) f if( des k>0) if(chair >1) System.out.printin("Up"); else if(chair 1)) System.out.printin("Down"); else System.out.printin("Left"); else System.out.printin("Right"); What values for desk and chair will display "Up"? public class ifs 8 Switch private static int desk = private static int chair = public static void main(String[] args) i if( desk > 0) if(chair >1) System.out.printin("Up"); else if(chair km 2 s.8 (desk >1)) System.out.printin("Down"); else System.out.printin("Left"); else System.out.printin("Right"); ) aces =1 and chair -2 b. desk =0 and chair -3 fesk =1 and chair n0 What values for desk and chair will display "Up"? public class ifs 8 Switch private static int desk = private static int chair = public static void main(String[] args) i if( desk > 0) if(chair >1) System.out.printin("Up"); else if(chair km 2 s.8 (desk >1)) System.out.printin("Down"); else System.out.printin("Left"); else System.out.printin("Right"); ) aces =1 and chair -2 b. desk =0 and chair -3 fesk =1 and chair n0 What will be displayed by lines 2 and 3 if plane is assigned a value of t in line 12 . public class Ifs 85 witch ( public static void main(String[] args) i 1intplane=intbike=1train=10;switch(plane)case1:bike=2;train=2;plane=3;break;case2;bike=3;train=3;case3;bike=4;train=4;break;defaut:bike=5;train=5; case 2: bike =3; train =3; case 3 : bike =4 train =4; break; default: bike = 5 ; train =5; 1 2 System.out.printin("the answer is " 3 + (bike + train)); The answer is 6 b. The answer is 8 c. The answer is 10 a. The answer is 4 e. The answer is 11 public class Ifs 8 wwitch private static int desk = private static int chair = public static void main(String[] args) f if ( des k>0) If(chair > 1) System.out.printin("Up"); else if(chair >1) ) System.out.printin("Down"): else System.out.printin("Left"); else System.out.printin("Right"); - desk =2 and chair m1 b. desk =0 and chair m3 desk -1 and chair -2 desk =1 and chair =0

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_2

Step: 3

blur-text-image_3

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

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions