simple answer please and valid answer on my homework.
Posted: Sat Nov 27, 2021 2:22 pm
simple answer please and valid answer on my homework.
Exercise 4 Collapse Conditionals -> Coding Exercise - Conditionals Exercise4.java public class Exercise4 { 2 public static void main(String args[]) { 3 4 String x = args[0]; 5 //add code below this line 6 7 8 9 10 //add code above this line 11 } 12 } Exercise 4 Problem Use the variable x as you write this program. x will represent a string. Write a program that determines if x is a primary color (red, blue, or yellow). If yes, print is primary color where the blank is the value of x. If no, print is not a primary color where the blank is the value of x. Expected Output • If x is red , then the output would be: red is a primary color. • If x is teal , then the output would be: teal is not a primary color Comparing Strings Compile code after you make changes COMPILE CODE Test your code with a few different values TEST WITH "RED" TEST WITH "TEAL"
Exercise 4 Collapse Conditionals -> Coding Exercise - Conditionals Exercise4.java public class Exercise4 { 2 public static void main(String args[]) { 3 4 String x = args[0]; 5 //add code below this line 6 7 8 9 10 //add code above this line 11 } 12 } Exercise 4 Problem Use the variable x as you write this program. x will represent a string. Write a program that determines if x is a primary color (red, blue, or yellow). If yes, print is primary color where the blank is the value of x. If no, print is not a primary color where the blank is the value of x. Expected Output • If x is red , then the output would be: red is a primary color. • If x is teal , then the output would be: teal is not a primary color Comparing Strings Compile code after you make changes COMPILE CODE Test your code with a few different values TEST WITH "RED" TEST WITH "TEAL"