public class TwoColors { public static void main(String[] args) { Scanner in = new Scanner(System.in); 10 11 12 13 14 15 16 System.out.print("Enter your first favorite color: "); 17 // Step 2: Read in...

Fix the code, make it look like the expect
public class TwoColors<br>{<br>public static void main(String[] args)<br>{<br>Scanner in = new Scanner(System.in);<br>10<br>11<br>12<br>13<br>14<br>15<br>16<br>System.out.print(

Extracted text: public class TwoColors { public static void main(String[] args) { Scanner in = new Scanner(System.in); 10 11 12 13 14 15 16 System.out.print("Enter your first favorite color: "); 17 // Step 2: Read in the next line of input and assign it to a String variable colorl 18 19 // 20 String colorl = in.nextLine(); 21 22 23 24 // Step 3: Trim spaces from both end and convert the input to all lowercase and assign it back to the same variable 25 26 // 27 // 28 29 colorl = colorl.toLowerCase); System.out.println("Enter your second favorite color: "); 31 32 // Step 4: Read in the next line of input and assign it to a String variable color2 33 // 34 35 String color2 = in.nextLine(); 36 37 // Step 5: Trim spaces from both end and convert the 38 // // input to all lowercase and assign it back to the same variable 39 40 41 color2 = color2.toLowerCase(); 42 43 44 45 // Step 6: Display a message according to the following: // 46 first color second color message That's wonderful! That's even better! 47 // // // light blue red 48 red light blue 49 otherwise That's also great! if(color1.equals("lightblue") && color2.equals("red")){ 50 MacB esc 80 00 F1 F2 F3 F4 F5
41<br>color2 = color2.toLowerCase();<br>42<br>43<br>44<br>// Step 6: Display a message according to the following:<br>//<br>45<br>46<br>first color<br>second color<br>message<br>That's wonderful!<br>That's even better!<br>That's also great!<br>47<br>light blue<br>. red<br>otherwise<br>//<br>red<br>48<br>light blue<br>//<br>//<br>49<br>50<br>if(color1.equals(

Extracted text: 41 color2 = color2.toLowerCase(); 42 43 44 // Step 6: Display a message according to the following: // 45 46 first color second color message That's wonderful! That's even better! That's also great! 47 light blue . red otherwise // red 48 light blue // // 49 50 if(color1.equals("lightblue") && color2.equals("red")){ 51 System.out.println("That's wonderful!"); 52 else if(colorl.equals("red") & color2.equals("lightblue")){ System.out.println("That's even better!"); 53 54 55 56 else{ System.out.println("That's also great!"); } 57 58 59 60 } 61 } 62 CodeCheck Reset Download Testing TwoColors.java Test 1 Input: red LIGHT BLUE Expected Actual Enter your first favorite color: Enter your second favorite color: Enter your first favorite color: Enter your second favorite color: That's even better! That's also great! fail Test 2 MacBook Air DII F9 FB
Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here