Question: M02 Programming Assignment Start Assignment Submitting a text entry box, a website URL, or a file upload You are expected to follow good programming standards
M02 Programming Assignment
Start Assignment
Submitting a text entry box, a website URL, or a file upload
You are expected to follow good programming standards for this and all assignments.
Assignment:
1: The colors red, blue, and yellow are known as primary colors because they cannot be made by mixing other colors. When you combine two primary colors, you get a secondary color, as shown here:
When you combine red and blue, you get purple.
When you combine red and yellow, you get orange.
When you combine 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. (15 points)
2: In mathematics, the notation n! represents the factorial of the nonnegative integer n. The factorial of n is the product of all the nonnegative integers from 1 to n. For example,7!=1234567=5,040
and4!=1234=24
Write a program that lets the user enter a nonnegative integer and then uses a loop to calculate the factorial of that number. Display the factorial. (15 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
