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

  Write a recursive program to generate random sentences

A BNF grammar is a recursively defined file that defines rules for creating sentences from tokens of text. Rules can be recursively self-similar. The following grammar can generate sentences such as "Fred honored the green wonderful child":

  Generally about what it development and operations

The novel is generally about what IT Development and Operations (Dev-Ops) has to learn from manufacturing. Summarize as a list, what these recommendations are. For each recommendation, list a page in the novel where the recommendation is made or r..

  Collector approves some of requests

Step 1: a remote data collector publishes sensing tasks to all mobile users (e.g., through smartphones carried by users) in the system. A task contains a task identifier and a task description. Step 2: the mobile users who are interested in a tas..

  It budget on security

What you need to convey to your CEO is that network attacks are continuing to make the news and organizations have reacted by increasingly spending more of their overall IT budget on security. Business executives are starting to have questions about ..

  How are they same and different

How are they the same? How are they different?

  What is the rate of return on the stock

What is the rate of return on the stock if the current stock price is $29.60 a share?

  Intel processors in android phone and tablets

Compare and contrast the different Intel processors in Android phone and tablets.

  Encryption in wireshark capture

How to determine symmetric or asymmetric encryption in wireshark capture.

  What is primary security risk users acknowledge using macros

Write a 200- to 300-word response that answers the following question: Based on the article by Lenning (2005), what is a primary security risk that users should acknowledge when using macros?

  Powerful component of ssis

Question: Explain why variables called the most powerful component of SSIS.

  Use the following formula to calculate a car''s mpg

C sharp Write C# code to prompt a user to enter the number of miles he or she has driven and the gallons of gas used

  Explain how base two and base eigth are related

Convert the following numbers from the base shown to base 10. Explain how base 2 and base 8 are related.

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