Create a program that could be used in a Coffee Corner store to calculate customer change....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a program that could be used in a Coffee Corner store to calculate customer change. The program should prompt for a specific product, for the cost of the product, and for the dollar amount customer has provided. Yes, we are using cash. Calculate change by using largest denominations first. For example, if change due is $7.98 the change would involve 1 $5 bill, 2 $1 bills, 3 quarters, 2 dimes, 3 pennies. HINTS: 1. Your input for both cost and customer amount paid will involve decimal values. Convert these to an equivalent representation that is integer. You need to keep the numbers (pennies) that were to the right of decimal point; you just want to shift the decimal point. How would you do this? 2. Refer to the example worked in class on 2/7 for hours, minutes, and seconds. Script will be posted to the InClass assignment on course site. 3. I strongly recommend that you start simple. Make your program work first for returning nickels and pennies only. Then make it work for dimes. Modify again for quarters and so on. Your goal is to get up to $5 bill. Create a program that could be used in a Coffee Corner store to calculate customer change. The program should prompt for a specific product, for the cost of the product, and for the dollar amount customer has provided. Yes, we are using cash. Calculate change by using largest denominations first. For example, if change due is $7.98 the change would involve 1 $5 bill, 2 $1 bills, 3 quarters, 2 dimes, 3 pennies. HINTS: 1. Your input for both cost and customer amount paid will involve decimal values. Convert these to an equivalent representation that is integer. You need to keep the numbers (pennies) that were to the right of decimal point; you just want to shift the decimal point. How would you do this? 2. Refer to the example worked in class on 2/7 for hours, minutes, and seconds. Script will be posted to the InClass assignment on course site. 3. I strongly recommend that you start simple. Make your program work first for returning nickels and pennies only. Then make it work for dimes. Modify again for quarters and so on. Your goal is to get up to $5 bill.
Expert Answer:
Answer rating: 100% (QA)
Code def calculatechangecost amountpaid Convert cost and amount paid to cents integer representat... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Explain what is Defi (blockchain) what is their function? what problem does Defi solve? Why should we care about Defi? Some statistic about Defi in 2022-2023
-
Coral Divers Resort Jonathon Greywell locked the door on the equipment shed and began walking back along the boat dock to his office. He was thinking about the matters that had weighed heavily on his...
-
Have a C compiler which is ANSI conforming in all respects except that it has no facility for the definition, declaration or use of standard C structures. Outline a set of routines written in this...
-
You need to write a paper about the leadership and your responsibility in an organization. Which types of problems can be occurred and how can you face them
-
Why might it be difficult to quantify some qualitative factors in developing decision models?
-
The summarized balance sheet of Separate Company on January 1, 20X3, contained the following amounts: On January 1, 20X3, Joint Corporation acquired 70 percent of the common shares and 60 percent of...
-
What went wrong with Heathers efforts at direct motivation?
-
Clonex Labs, Inc., uses a process costing system. The following data are available for one department for October: The department started 175,000 units into production during the month and...
-
The marketing mix includes all but which of the following:Select oneA. Physical EvidenceB. PatienceC. PlaceCD. ProductE. Price
-
Which of the following can facilitate a climate for transfer within an organization? Multiple select question. Perceived supervisor support Opportunities to use newly learned skills Peer support Perfo
-
On January 1, 2021, X Company estimated the following costs for the year: Direct materials$61,700 Direct labor96,900 Factory supplies19,800 Factory maintenance28,000 Advertising46,200 Factory...
-
Need to discuss the 6Ps of marketing by Chick-Fil-A and their market segmentation What are the 4Ps of marketing by Nike and how does Nike segment its customers A paragraph for each
-
"Total cost of a product: Rs 10,000. Profit: 25% on Selling Price What is the profit? Profit on C.P = 10000 25/100 = 2500 Profit on S.P = 2500/(10000-2500) 10000 = Rs. 3,333. The question is how to...
-
This week is a bit different. As you have seen from your readings, learning how to advocate for ourselves while emphasizing our accomplishments is difficult for a majority of women. It simply does...
-
Identify one (or more) sectors in US economy (e.g. banking/technology/materials etc.) that you think are over-valued and are either going through market adjustment or likely to see a market...
-
The report distribution options to use email links or email attachments is only available with __________ reports
-
Assume a simple Keynesian depression economy with a multiplier of 4 and an initial equilibrium income of $3,000. Saving and investment equal $400, and assume full employment income is $4,000. a. What...
-
Evaluate an investment using all four methods (Learning Objectives 2, 4) Zippi manufactures motorized scooters in Oakland, California. The company is con sidering an expansion. The plan calls for a...
-
Retirement planning in two stages (Learning Objective 3) You are planning for an early retirement. You would like to retire at age 50 and have enough money saved to be able to draw $225,000 per year...
-
Apply time value of money to a personal decision (Learning Objective 3) Ted Christensen, a second-year business student at the University of Utah, will grad uate in two years with an accounting major...
Study smarter with the SolutionInn App