Question: int vOne = 15; int vTwo = 32; String vThree = Three is the key; String vOut = nada; if (vOne + vTwo == 46

int vOne = 15; int vTwo = 32; String vThree = "Three is the key"; String vOut = "nada"; if (vOne + vTwo == 46 && vTwo % 10 == 0 || vThree.length() > vOut.length()){ vOut = "woopie"; } System.out.println("If-else A: " + vOut); vOne = 18; vOut = "green"; if (vOne <= 20){ vOut = "pink"; }else if (vOne <= 10){ vOut = "black"; }else if (vOut.charAt(4)=='n'){ vOut = "blue"; }else{ vOut = "red"; } System.out.println("If-else B: " + vOut); int compare = "HELLO".compareToIgnoreCase("hello!"); if (compare < 0) System.out.println("If-else C: pink"); else if (compare > 0) System.out.println("If-else C: black"); else System.out.println("If-else C: blue"); //----------------------------------------------------------------- total = 0; for(cntr=1; cntr<20; cntr+=2){ total++; } System.out.println("For A: " + total); String str = ""; for(cntr=4; cntr<10; cntr+=2){ int amper = cntr % 3; if (amper == 0) str = str + "A"; else if (amper == 1) str = "B" + str; else str = str.substring(1, 2); } System.out.println("For B: " + str); total = 0; for(int c1 = 1; c1 > -1; c1--){ for(int c2 = 0; c2 < 3; c2++){ total = total + c1 - c2; } } System.out.println("For C: " + total); total = 0; for(int c1 = 1; c1 < 3; c1++){ for(int c2 = 0; c2 < c1; c2++){ total = total + c1; } } System.out.println("For D: " + total);

If-else A: _____ ? If-else B: ____ ? If-else C: ____ ? For A: ____ ? For B: ____ ? For C: ____ ? For D: ____

A. blue B. -3 C. true D. woopie E. A F. black G. pink H. 75 I. 10 J. nada K. 5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!