Give amounts of money to customers

Assignment Help Basic Computer Science
Reference no: EM131991924

A bank teller who has to give amounts of money to customers but can't count very well so needs you program to help them.

a) Write C program that will accept an integer value in the range of 5-95 and as a multiple of 5 representing the number of cents to give to a customer in their change. The program should calculate how many coins of each denomination and display this to the user. Valid coin values are 50, 20, 10 and 5. Your solution (program and algorithm) should be modular in nature. This requires the submission of a high-level algorithm and suitable decompositions of each step.

- for this problem the principle of code reuse is important

-should have one function in particular that can be reused (called repeatedly) in order to solve the majority of the problem

b)write C program that will allow the user to enter the amount of change as dollars and cents as a double (real number). Valid dollar values are 100, 50, 20, 10, 5, 2 and 1. The program should output the correct combination of dollar and cent denominations required and should be able to work for any valid dollar amounts. Cents amounts may be should be multiples of 5.

-you will need to explicitly convert a double to an integer to break the inputted double down to its component parts as integers

-use code below as the basis float change; int dollar, cents;

...

dollar = (int) change;

cents = (int) (((change - dollar)*100) + 0.5);

Reference no: EM131991924

Questions Cloud

Present value of each of your cousin debts : f the present value of each of your cousin's debts is the same, what is t?
Compare the salaries for the same job : Compare the salaries for the same job in two (2) different geographic locations within the United States. Speculate on two (2) economic influences.
In calculating total cash flow to firm : In calculating total cash flow to a firm, which of the following is not included?
Why do corporations employ investment bankers : Why do corporations employ investment bankers? Identify the primary market functions of investment bankers.
Give amounts of money to customers : A bank teller who has to give amounts of money to customers but can't count very well so needs you program to help them.
How applicable is the intervention to diverse families : What may be advantages or disadvantages of the systemic intervention based upon whether the family or the individual is the focus of treatment?
Briefly define grices four conversational maxims : Briefly define Grice's four conversational maxims and give a concrete example of a breach (or violation) of each one.
What should be the order of the interviews : What should be the order of the interviews? Would you consider interviewing Tommy, Andy, and Janet? Why or why not? How would you go about interviewing.
What are protective barriers and what should they entail : What are protective barriers and what should they entail? What mitigation procedures can be used to ensure the resiliency of protective barriers?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What influence the concept of pervasive computing

What you believe the eventually influence will be of concept of "pervasive computing" or"location based services" will be on society.

  What is the expected price for his firm in five years

A justified P/E ratio of 13.5 can be used in the valuation of this stock. What is the expected price for his firm in five years?

  Assess your knowledge and growth

Explain what you learned about the Website you selected by looking at the source code. (i.e., the version of HTML that was used, comment tags, if the head elements were marked, and if so, the type of information they contained.) Thinking back to the ..

  Company owns another plant that your predecessor

You have two plants at your disposal but are currently only using #1 which has a marginal cost function of MC1= Q (This suggests that your total costs are TC1=Q

  Program to calculate target heart rate

Write a program to calculate target heart rate during fitness training. This program has two functions: main and heart_rate_calculator. Please do the following:

  Write a program that reads strings from input

Write a program that reads strings from input and outputs them sorted, by length, shortest string first. If a subset of input strings has the same length.

  Organizational risk appetite and risk assessment

Imagine that a software development company has just appointed you to lead a risk assessment project. The Chief Information Officer (CIO) of the organization has seen reports of malicious activity on the rise and has become extremely concerned wit..

  Develop formulas for the hybrid hash-join algorithm

Develop formulas for the hybrid hash-join algorithm

  What are the tls parameters

What are the TLS parameters (the public key encryption algorithm, the symmetric cipher and key length, and the cryptographic hash algorithm) negotiated by the client and server?

  Strategic options for legacy system evolution

What are the strategic options for legacy system evolution? When would you normally replace all or part of a system rather than continue maintenance of the software?

  What was the price of each type of candy

She spent a total of $40.10. Tommy spent $39.60 on 6 sticks of gum, 4 suckers, and 10 bags of jelly beans. Finally, Janet bought 7 sticks of gum, 10 suckers, and 8 bags of jelly beans for 44.50. What was the price of each type of candy?

  Post a link to a blog-twitter

Edward Tufte (Links to an external site.) is the grandfather of championing the high quality visual display of graphical information. Along with his rising influence, a large number of other data visualization experts and consultants have emerged..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd