Write a program that prompts a user to enter names of colors

Assignment Help Programming Languages
Reference no: EM131316500

The colors red blueand yellow are known as the primary colors because they cannot be made by mixing other colors. When you mix two primary colors, you get a secondary color as shown here:

When you mix red and blue you get purple
When you mix red and yellow you get orange
When you mix blue and yellow you get green

Write a program that prompts a user to enter the names of two primary colors to mix, If the user enters anything other than "red", "blue",or yellow", the program should display an error message. Oterwise the program should display thename of the secondary color that results by mixing two primary colors.

This is a C++ program and needs to be saved as a cpp file.

Reference no: EM131316500

Questions Cloud

Prepare the journal entry to record the annual amortization : Martinez, Inc. acquired a patent on January 1, 2016 for $41,600 cash. The patent was estimated to have a useful life of 10 years with no residual value.  Prepare the journal entry to record the acquisition of the patent on January 1, 2016. Prepare th..
Find an expression for the slope of the production : Draw a production isoquant. Put D on the vertical axis. Put N on the horizontal axis - Draw an isocost fine. Put D on the vertical axis. Put N on the horizontal axis. Find the slope of that line (dD/dN).
Do the low buyback prices offered to us franchisees : Do the low buyback prices offered to U.S. franchisees reflect poor Body Shop ethics or just the economic reality of risky investments?
Provide an equivalent iterative implementation : Write a recursive method that given n, computes the nth term of that sequence. Also provide an equivalent iterative implementation. How do the two implementations compare?
Write a program that prompts a user to enter names of colors : Write a program that prompts a user to enter the names of two primary colors to mix, If the user enters anything other than "red", "blue",or yellow", the program should display an error message.
The company cost of equity capital : The Graber Corporation’s common stock has a beta of 1.2. If the risk-free rate is 5.2 percent and the expected return on the market is 10 percent, what is the company’s cost of equity capital?
Explain the purpose of a company : Explain the purpose of a company's 10-K and how it interprets the firm's financial strength. Write a description of three important items, including their significance to stakeholders, that you learned from reading Ford Motors Company's 10-K for 2..
Pledges to maintain constant four percent growth rate : Lohn Corporation is expected to pay the following dividends over the next four years: $18, $14, $10, and $5.50. Afterward, the company pledges to maintain a constant 4 percent growth rate in dividends forever. If the required return on the stock is 1..
Write the code that will execute according to the program : Design a Windows application and write the code that will execute according to the program requirements in Figure 4-104 and the Use Case definition in Fig 4-105.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write if statement to display acceptance messag

Write an if statement that displays an acceptance message for an astronaut candidate if the person's weight is between the values of opt_min.

  What is the standard terminal symbol for a flowchart

What might be considered the seventh step of the programming process?

  Write functions to change and display attributes

Write class player which contains attributes for players name,average and team. Write three functions to change and display these attributes.

  Give the pseudocode for the enqueue

Show how to implement a queue using two stacks S1 and S2 so that the amortized cost of each operation on the queue is O(1).

  Draw application which reads inventory records file

Draw an application which reads inventory records file and produces a report whihc show item-number, item-description, and price of every item on each day, one through 7.

  Program to convert the currency

Display "Enter a currency value (positive number):"

  Discuss what is meant by low-level programming

Discuss what is meant by "low-level" programming. What are the advantages of assembly language over higher-level languages for this type of programming?

  Wite a program to display a countdown timer

Wite a program to display a countdown timer which displays minutes and seconds as the timer counts down from the starting point. At runtime, the user should be asked how many minutes they want the timer to countdown.

  What are the benefits of the two when developing a compiler

What is the difference between top-down and bottom-up parsing

  Tools assist novice programmer to generate code

Structured English and gave to a novice programmer who used it to create code? If not, what other tools could be used to assist the novice programmer to generate code?

  Explaining class definition of subclass of square

Write down the class definition of subclass of Square called FancySquare which has a method called getDiagonal. The getDiagonal method gets no arguments.

  Output of the given program

Output of the given program - using namespace std - g^x = h mod p, find x. ex: 7^x = 15 mod 41, x = 3

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd