Design a program that prompts the user to enter the names of two primary colors
ID: 3012065 • Letter: D
Question
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. Assume that hot does come Write a program that calculates the number of packages of hot dog buns needed for cookout, with the minimum amount of leftovers. The program should ask the user for the number of people attending the cookout and the number of hot dogs each person will be given. The program should display the following details: The minimum number of packages of hot dogs required The minimum number of packages of hot dogs that will. be left over. The number of hot buns that will be left over. The number of hot dogs buns that will be left over. On a roulette wheel, the pockets are numbered from 0 to 36.Explanation / Answer
Here we write a C++ program as :
main()
include<iostream.h>;
{ int a,b,c,d,e,f,g;
cin << " The number of people attending the event ="<<a;
cin << " The number of hot dog to be given to each person = "<<b;
cin << " The number of hot dog to be given to each person = "<<c;
d= ab/8; \ total packages of hot dogs required
e= ac/10 \ total packages of hot dog buns required
int f= ab % 8; \ gets remainder of the division
int g = ac % 10;
cout>> " The minimum number of pakages of hot dog required =" <<d;
cout>> " The minimum number of pakages of hot dog buns required =" <<e;
cout>> " The number of hotdogs that will be left over =" <<f;
cout>> " The number of hot dog buns that will be left over=" <g;
}
end;
Note : Using same algorithm, this program can be written in any language. I wrote it in C++ as no specific software is specified in question.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.