Design a program that prompts the user

Assignment Help Basic Computer Science
Reference no: EM131687965

The colors red, blue, and 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.

Design a program that prompts the 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. Otherwise, the program should display the name of the secondary color that results.

Note: Color names must be treated as string values: "red", "blue", "yellow"

Reference no: EM131687965

Questions Cloud

What dyes make an mms candy orange or a skittles candy red : What dyes make an M&M's candy orange or a Skittles candy red? Do all blue candy coatings use the same color dyes? Is black ink really black?
Diagnosing and troubleshooting networks : Discuss tools and utilities available within Windows or Mac for diagnosing and troubleshooting networks.
Discuss the impact that cultural differences : Discuss the impact that cultural differences may have on each of the stages in Dr. Kubler-Ross theory
Strengths and weaknesses compared to a cost-benefit analysis : What acceptable methods can be used to show the costs and benefits of training without collecting statistics and conducting analyses?
Design a program that prompts the user : Design a program that prompts the user to enter the names of two primary colors to mix. If the user enters anything other than "red.
Why do organizations need a variety of leadership approaches : Comparing Leadership Theories Select any three traditional leadership theories to compare and contrast. How are they similar and how are they different?
Construction in developing countries : write a brief report on the activities that takes place in the developing certain number of developing country- Describing the relation between the construction
Effectiveness of the first level leaders development program : Evaluating the Returns on Leadership Development at BP Through mergers and acquisitions, BP, a global energy company, has doubled in size in just five years.
Environmental risk factors that contribute to suicide : Environmental risk factors that contribute to suicide include family stress and conflict such as divorce, death of a loved one, academic failure, and abuse.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Using social media for marketing

Using Social Media for Marketing

  What is linear speed in miles per hour of a point on tire

Suppose the wheel turns at a constant rate of 2.75 revolutions per second. What is the linear speed in miles per hour of a point on the tire?

  What is an erp application system

What is an ERP application system?

  Numbers and inserts them into an array list

Write a loop that reads 10 double numbers and inserts them into an array list. Find the maximum, minimum and average of the numbers.

  Prompt the user for the number of sides

1.Prompt the user for the number of sides on the die.2."Roll" the die three times by generating a random number between 1 (inclusive) and the number of sides (inclusive).3.Keep track of the running sum of the rolls for the die and output the sum and ..

  Compute the minimum operating cost and optimum values

A newly harvested grain system (Stoecker 1971) has a high moisture content and must be dried to prevent spoilage. The drying can be achieved by blowing it with air. The seasonal operating cost in dollars per square meter of the grain bed for such ..

  Information system in organisation

How have the internet and the world wide web changed the role played by information system in organisation?

  Strengthen understanding of empowerment and communications

The exercise will provide insight into how managers influence the direction of team cohesion. Completion of this assignment will strengthen understanding of empowerment and communications.

  What is a piecewise polynomial

State three shortcomings of polynomial interpolation that are improved upon by piecewise polynomial interpolation.

  Search to terminal nodes

Write a program, to play ?ve-by-?ve tic-tac-toe, where four in a row wins. Can you search to terminal nodes?

  Demand and supply curves

Ceteris Paribus, using demand and supply curves, explain how trade liberalization leads to lower prices and more quantity available for consumers.

  History of the twenty-first century

Friedman, T. L. (2005). The World is Flat: A Brief History of the Twenty-first Century. New York: Farrar, Straus and Gioux, PAGES 308-373, 477-530.

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