Ask Question, Ask an Expert


Ask C/C++ Expert

Home >> C/C++

problem 1) Design computer program which find outs minimum number of coins and bills required to make change for the particular purchase. You must prompt the user for the cost of the item and amount tendered. Your program must indicate how many coins and bills of each denomination are required for change. Make use of these denominations.

Coins: $0.01, $0.05, $0.10, $0.25, $1, $2

Bills: $5, $10, $20, $50, $100

Your program must be able to process one set of input data at a time. You must run your program for all the given data sets to see if it would give you the proper output.

You should input from the file and output to the file. Use end of file function for the loop input.

You should use a function to input and do the data validation. Use one function to do the change and one function to do the output. Ensure the output format is exactly the same as given in this assignment.

An suitable error message must be printed for any invalid input data, that is, if the cost is less than or equal to 0.0, or if the amount tendered is less than the cost.

You must hand in a user documentation and a programmer documentation including storage layouts and a variable list (showing all variables and their meanings.)

Use the following input data sets. The first column is for 'cost' and the second column is for 'money tendered'. Your output must look like the sample output.

Use 'divide' and 'modulus' function for integers. You could convert everything to cents to avoid rounding errors.


cost tendered change: $10 $5 $2 $1 $0.25 $0.10 $0.05 $0.01

10.50 20.00
3.00 10.00
2.50 5.00
4.80 10.00
3.33 5.00
1.99 1.00
0.29 1.00
6.53 10.00
0.00 10.00
5.00 0.25
9.99 10.00
10.89 11.00

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M94680

Have any Question? 

Related Questions in C/C++

Here are two examplesifcounter7continueifcounter7break1

Here are two examples: if(counter==7) continue; if(counter==7) break; 1. Write a for loop that counts only the odd numbers out of the first five numbers entered from the keyboard, but does not count (skips) the number 7. ...

Text exercise 413 gas mileagebulldrivers are concerned with

Text Exercise 4.13 (Gas Mileage) • Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several trips by recording miles driven and gallons used for each trip. Develop a C++ ...

Pa 1 word countertabulating basic document statistics is an

PA #1: Word Counter Tabulating basic document statistics is an interesting exercise that leverages your knowledge of strings, files, loops, and arrays. In this homework, you must write a C++ program that asks the user fo ...

Write code to create the generator submit your source code

Write code to create the generator. Submit your source code as well as a description of how I could run the program, sample screenshots of the program in action, and the various changes that could be produced through you ...

Write a program that calculates mileage reimbursement for a

Write a program that calculates mileage reimbursement for a salesperson at a rate of $0.35 per mile. Your program should interact with the user in this manner: MILEAGE REIMBURSEMENT CALCULATOR Enter beginning odometer re ...

1 learner objectivesat the conclusion of this programming

1. Learner Objectives: At the conclusion of this programming assignment, participants should be able to: * Apply repetition structures within an algorithm * Construct while (), for (), or do-while () loops in C * Compose ...


Program Write a C++ program that will: Ask the user for the name of an input file. Read in this name and open that text file for input. Ask the user which of two options they want to do: Read in student data Count lines ...

Problem 1overview for problem 1a of this assignment you

Problem #1 Overview: For problem 1(a) of this assignment, you will need a C++ compiler. In order to receive credit, your program must compile and run; and you must provide the actual source code file so that I can compil ...

Cs492 programming assignment-the program must be written in

CS492 Programming Assignment- The program must be written in C or C++, and run on a linux machine. ALL source code you submit must be well documented (documentation is an indicator of understanding!) Programs that cannot ...

This program involves using stl listsfor this program you

This program involves using STL lists. For this program you will implement three functions whose prototypes are given below: list ::iterator mxIter(list ::iterator first, list ::iterator last); void selectSort(list & aLi ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate