Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#include using namespace std; Collapse Conditionals -> Coding Exercises: Conditionals int main(int arge, char** argv) { 1, 2 3 4, 5 6 7 8 9
#include using namespace std; Collapse Conditionals -> Coding Exercises: Conditionals int main(int arge, char** argv) { 1, 2 3 4, 5 6 7 8 9 10 4. Exercise 4 string x = argv[i]; //add code below this line Conditionals Exercise 4 11 //add code above this line return 0; 12 13 14 15 16 + 17 } 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 a primary color, where the blank Q) is the value of x. If no, print, is not a primary color where the blank () is the value of x. For this particular exercise, make sure that your code specifically checks if the variable x is equivalent to the strings red, blue, or yellow in all lowercase. Otherwise, your test cases will fail. o IMPORTANT There is a difference between all of the following strings: "red", "Red", and "RED". When comparing strings, the system is case- sensitive and will attempt to match each character of the strings to each other based on whether it is uppercase or lowercase 0% (1:0)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started