Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

#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

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

Step: 3

blur-text-image

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago