Create a program that calculates change after a purchase

Assignment Help Basic Computer Science
Reference no: EM13711992

Create a program that calculates change after a purchase. This will be a sequential algorithm, which is one of the simplest programming patterns. Your solution requires no branching or looping. Simply write a series of statements that will execute in order.

The program should ask for a purchase price and the amount of cash tendered. It should then determine how many of the following denomininations should be returned:
penny
$0.01
nickel
$0.05
dime
$0.10
quarter
$0.25
dollar
$1.00
five
$5.00
ten
$10.00
twenty
$20.00


Sample Run

Price of the item:
21.37
Cash tendered:
50.00
Change: 28.63
Change Left: 2863
twenties: 1
tens: 0
fives: 1
ones: 3
quarters: 2
dimes: 1
nickles: 0
pennies: 3
Notes

This program is easier if you consider the following ideas:
You'll have to figure out how much of each amount is required
You'll need to know what's left after you've accounted for each denomination
Look up the modulus operator
Modulus works better with integers
It may be better to work in pennies rather than dollars

Reference no: EM13711992

Questions Cloud

Differences between lans and wireless lans : Wireless networks have become a pervasive part of society today. Let's focus our discussion on Wi-Fi also known as the IEEE 802.11 standards group. The latest member of the 802.11 family is 802.11n. What are some immediately noticeable differe..
Draw a hierarchy chart and plan the logic : Draw a hierarchy chart and plan the logic for a program for the sales manager of The Potato Furniture Company.The manager needs a program to dertemine the profit on any item sold,input includes the wholesale price and retail price for an item ..
An ideal embedded operating system : In an ideal embedded operating system, would all non-kernel threads always execute at lower priority than interrupts? Why?
Discuss how automated cybersecurity tools : 1. Prevent, Detect, and Respond to Cyber Attacks Discuss how automated cybersecurity tools can support operations personnel as they attempt to prevent, detect, and respond to cyber-attacks against a company's networks and information systems.
Create a program that calculates change after a purchase : Create a program that calculates change after a purchase. This will be a sequential algorithm, which is one of the simplest programming patterns. Your solution requires no branching or looping. Simply write a series of statements that will exec..
Database and data warehousing design : Assignment consists of two (2) sections: a design document and a revised project plan. You must submit both sections as separate files for the completion of this assignment. Label each file name according to the section of the assignment it is ..
The officer who tagged and bagged evidence : "You receive a computer system from the officer who tagged and bagged evidence at a crime scene in suspects home. you examine the compuer and discover that it uses a SCSI drive on a windows system .
Propose remedies the law provides for the violations : Propose remedies the law provides for the violations. Write a summary of your findings. Prior summarizing, list your major findings from the discussion and this assignment in a bullet-point list. Collate all your findings in the summary keeping ..
The fundamentals of data warehousing architecture : Using academic databases such as the ACM database, IEEE database, INFORMS database, Elsevier database, or Google Scholar, locate relevant, current, and academic sources covering data warehouses and data mining. Topics can include the fundamenta..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Submit the flowchart of your working program.

Also submit the flowchart of your working program. Make sure you run it to make sure it is error free and does what it is supposed to.

  How many automobiles are to be described

How many autos do you want?: 2 Enter make: Honda Enter color: Blue Enter make: Chevy Enter color: Red You have a Blue Honda. You have a Red Chevy.

  Http server may initiate interaction client true or false

In HTTP, a server may initiate an interaction with the client. a)Answer True b)False

  Draw mind map to show risks and actions and strategies

Draw a mind map to show the risks and the actions and strategies that would ensure the integrity of your data, and the optimisation of a computer.

  What are the implications for companies seeking to learn

Mark Jamison of Kimberly Clark notes that it is business processes and not the technology (e.g RFID)itself, what bring value to the supply chain.What does he means by that. what are the implications for companies seeking to learn from the likes of..

  Every programming language have several commonalities

The basics of every programming language have several commonalities

  Find the values of a and b such that error is minimized

Find the values of A and B such that error is minimized. What power of h is the error proportional to?

  Type of information of microsoft useful inprofessional life

What kind of information on the site do you find to be valuable to you? What kind of information about Microsoft Word do you find to be useful in your personal or professional life? Explain.

  What kind of watermarking mechanism

What kind of watermarking mechanism can you propose to protect an image copyright?

  Describe the security vulnerabilities expoited

Describe the security vulnerabilities expoited by the hackers in the 21st century bank heist case study

  What interface does an application need to use

What interface does an application need to use if it wants to get updates on the current position of the mouse cursor as the mouse is being moved? How does the program get the x,y coordinates of the mouse cursor?

  Is it possible for an instruction to be receiving forwarding

Is it possible for an instruction to be receiving forwarding information and simultaneously being flushed?If possible, can you provide an example sequence of instructions?

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