Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project 2: Purchase and Change Write a C++ program that prompts the user for a cash value and an amount of purchases made against that

Project 2: Purchase and Change

Write a C++ program that prompts the user for a cash value and an amount of purchases made against that amount. The program should then determine the change using the following US paper and coin currency denominations:

Fifty Cents, Twenty-Five Cents, Ten Cents, Five Cents, One Cent One Dollar Bill, Five Dollar Bill, Ten Dollar Bill, Twenty Dollar Bill

Display how many of each denomination would be needed to make change. In order to receive full credit, you must include a loop in your program. A sample program dialogue is shown below.

Enter a value: 32.00 Enter an amount of purchases made against this amount: 18.52 The remaining change is: 13.48 Twenty US Dollar Bills: 0 Ten US Dollar Bills: 1 Five US Dollar Bills: 0 One US Dollar Bills: 3 Fifty US Cents Coins: 0 Twenty-Five US Cents Coins: 1 Ten US Cents Coins: 2 Five US Cents Coins: 0 One US Cent Coins: 3

Continue(y/n)? n

HINT: Use integer arithmetic to ensure that the calculations are accurate.

HINT: The % (modulus operator) computes remainders but requires two integer operands.

File Upload

Google Doc

Google Drive

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

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions