High-level algorithm and suitable decompositions

Assignment Help Basic Computer Science
Reference no: EM131988957

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: EM131988957

Questions Cloud

Todays global business environment : What specific threats do YOU see in todays global business environment?
Discuss legal implications arising from bettys resistance : Should Jake's parents and other education professionals be involved in the decision process?
Discuss the difference between overloading : If a data member is declared as private, protected or public in a base class, discuss how it can or cannot be accessed in a public member function of a derived.
Explore how the cloud is being utilized now : Explore how the cloud is being utilized now. What opportunities exist to move to the cloud? Will it save money or solve a problem?
High-level algorithm and suitable decompositions : This requires the submission of a high-level algorithm and suitable decompositions of each step.
Explore how the use of web technology is currently utilized : Explore how the use of a Web 2.0 technology is currently being utilized in the BOI. How will this benefit the business? What risks are involved?
Best practices of normalization : What are the 3 best practices for entity relationship data modeling and the 3 best practices of normalization?
Describe and explain some of the hardening methods : Describe and explain some of the hardening methods of entry control.
Background-culture influence a person decision-making : How does a person's background and culture influence a person's decision-making?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  She will answer every question correctly

If the student can eliminate two of the possible answers on the first three questions, and if she guesses on every question, what is the probability that

  Application-incident response

Even with the best security system, an organization's information systems are never fully safe from outside attacks or malicious activities from insiders.

  Compute cpi of processor with given workload

Assume that there are no other hazards that require stalling. Compute the CPI of the above processor with the given workload.

  Write program to display shapes and colors

Write program to display shapes and colors that the user specifies through a GUI. The GUI should contain a JPanel on which the shapes will be drawn.

  What is the purpose of the setdata method

What are the names of the private data members in the Item class?

  Average of the three unemployment rates

Figure out the average unemployment rate, simply by doing the arithmetic average of the three unemployment rates for the quarter (add them up and divide by 3).

  Create any required pointers needed to complete insertion

Assume that the list pointed to by startPtr is maintained in alphabetical order. (Note: you do not know what is in the list, only that it is maintained in alphabetical order.)

  Describe the operation of a drum switch

Explain the transfer of data that occurs as the sequencer is advanced through its various steps.

  Draw the symbol table showing the labels and their addresses

Draw the symbol table showing the labels and their addresses.

  Manufacture and market the computer in europe

Several patents protect the unique design for this computer. Your CEO has asked you to formulate a recommendation for how to expand in Western Europe. Your options are:

  Threat vulnerability, and exploits assessment practices

There are multiple ways to bring threats and vulnerabilities to light. Common practices and lessons learned can help us explore for known or common threats, but how does an organization with a unique or highly unusual setup discover its vulnera..

  Affecting the field of healthcare technology

Affecting the field of healthcare technology.

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