Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

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.

SAMPLE OUTPUT

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++

Assignment simple 5-card poker gamein this assignment you

Assignment: Simple 5-Card Poker Game In this assignment, you will develop a simple poker game, complete with basic AI, using the object oriented programming principles discussed in class. Flow of Play Your poker game's p ...

Programming assignment- in this assignment you are

Programming Assignment- In this assignment you are requested to write a C++ program that displays the following colored pyramid on the screen: - The pyramid is 71 characters wide and 21 characters high. - To draw it, you ...

Writeacprogramthatwilluseloopstoperformeachofthefollowingtas

Write a C++ program that will use loops to perform each of the following tasks: 1. Ask the user for two characters from the keyboard and read them into char variables. Determine which input is larger and which is smaller ...

For this program you will add and test 2 new member

For this program you will add and test 2 new member functions to the IntSLList class posted on the website. The two member functions are: insertByPosn(int el, intpos) Assuming that the positions of elements of a list beg ...

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 ...

Descriptionnbspin this assignment you will write a c

Description:  In this assignment you will write a C++ program that finds the kth largest number among a set of N numbers. It will implement the solution using two different algorithms and measure the time elapsed during ...

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 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 ...

Discussion questonsplease respond to all of the following

Discussion Questons Please respond to all of the following prompts: • How are input and output accomplished in C++? • How do cin and cout relate to ostream and istream? Lab Activity 1. Write a C++ program per the require ...

Computer programming assignment-q1 using for loop write a c

Computer Programming Assignment- Q1. Using for loop, write a C++ program that prints out the multiples of 3 up through 75, separated by a blank space.  3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 ...

  • 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