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

Programming assignment 5write a c program that allows the

PROGRAMMING ASSIGNMENT #5 Write a C program that allows the user to make some banking transactions. The program should first prompt the user to enter the current balance of his/her bank account (in dollars and cents, not ...

Create your own unique while-end repetition structure you

Create your own unique While-End repetition structure. You decide the theme. You should provide both the pseudocode and the flowchart of your example. Be sure to provide an overview of what your repetition structure is d ...

Programming assignmentwrite a c program that allows the

PROGRAMMING ASSIGNMENT Write a C program that allows the user to make some banking transactions. The program should first prompt the user to enter the current balance of his/her bank account (in dollars and cents). The p ...

Assignmentconsider the following declarationsclass

Assignment Consider the following declarations: class bagType { public: void set(string, double, double, double, double); void print() const; string getStyle() const; double getPrice() const; void get(double, double, dou ...

Assignment part acreate a checkbook program using c

Assignment (part a) Create a Checkbook program using C : • Create a Check structure. Include:   o Check number (should be an integer).   o Date (use type char[ ]).   o To   o Amount   o Description • Add functions to:   ...

Transaction processing system tpsxyz electronics is one of

Transaction Processing System (TPS) XYZ Electronics is one of the most popular electronics companies In Sultanate of Oman the company offers affordable electronic gadgets such as mp3 players, portable movie players, mobi ...

Bankers algorithmimplement the bankers algorithm for

Banker's Algorithm Implement the Banker's algorithm for deadlock avoidance, that works on a given set of N processes and M resource types (N The input data and result is then displayed on the screen. You may use your pro ...

Assignmentobjectivespractice reading characters from a

Assignment Objectives Practice reading characters from a file Practice using command line input Practice using command-line redirection of files Practice implementing a double transposition ciphering algorithm Summary In ...

Assignment a random mazewrite a new c program with the

Assignment (a) Random Maze Write a new C++ program with the following functionality: The program writes a greeting on the screen. Then the program displays a maze of ASCII symbols on the screen. The maze consists of 8 ro ...

Write a c application that does the followingitem 1 prompts

Write a C++ application that does the following: ITEM 1: Prompts the user to choose one of the following series: 1 + 1/2 + 1/3 + ... + 1/n ((((x * 2) * 2) * ...) * 2) series of n multiplications x + (x * 1) + (x * 2) + ( ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen