Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

help please. purchase and the amount tendered. cout Enter amount of purchase and amount tendered: ; cin cost tendered; 7. The variables you will need

help please.
image text in transcribed
purchase and the amount tendered. cout "Enter amount of purchase and amount tendered: "; cin cost tendered; 7. The variables you will need are: double tendered; double cost; int change; int fifties, twenties, tens, fives, dollars, quarters, dimes, nickels, pennies; 8. After calculating the change, convert it to an integer by multiplying it by 100 and storing it in an int. change = (tendered cost )100+.5; 9. Then output the amount of change and a breakdown of how many fifties, twenties, tens, ones, quarters, dimes, nickels and pennies will be returned in change. 10. Then use division and modulo division to extract the numbers of bills and coins. fifties = change /5000; change = change of 5000 ; A typical run would be: Enter amount of purchase and amount tendered: 2.09100.00 For your purchase of \$2.09 you tendered $100 Your change is 97.91 Fifties: 1 Twenties: 2 Tens: 0 Fives: 1 Ones: 2 Quarters: 3 Dimes: 1 Nickels: 1 Pennies: 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

(5) What is the regression matrix (A) for this example? Pg45

Answered: 1 week ago