Write a program that prompts the user to enter some numbers ofpennies (1-cent co
ID: 3616744 • Letter: W
Question
Write a program that prompts the user to enter some numbers ofpennies (1-cent coins), nickles (5-cent coins), dimes (10-centcoins), quarters (25-cent coins), half dollars (50-cent coins), andone-dollar coins (100-cent coins). Query the user seperately forthe number of each size coin (ex. "How many pennies do you have?")Then your program should print out something like this: You have 23 pennies. You have 17 nickles. etc.... The value of all of your coins is 573 cents. You may have to use your imagination to get the numbers to addup right-justified. If only one coin is reported, make the output gramaticallycorrect... "14 dimes" and "1 dime" (not"1 dimes"). Also report thesum in dollars and cents, ie., $5.73 instead of 573 cents. Write a program that prompts the user to enter some numbers ofpennies (1-cent coins), nickles (5-cent coins), dimes (10-centcoins), quarters (25-cent coins), half dollars (50-cent coins), andone-dollar coins (100-cent coins). Query the user seperately forthe number of each size coin (ex. "How many pennies do you have?")Then your program should print out something like this: You have 23 pennies. You have 17 nickles. etc.... The value of all of your coins is 573 cents. You may have to use your imagination to get the numbers to addup right-justified. If only one coin is reported, make the output gramaticallycorrect... "14 dimes" and "1 dime" (not"1 dimes"). Also report thesum in dollars and cents, ie., $5.73 instead of 573 cents.Explanation / Answer
please rate - thanks #include using namespace std; int main() {int i,coins[5]={0},denom[5]={1,5,10,25,50},total=0; string names[5]={"penn","nickel","dime","quarter","halfdollar"}; for(i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.