Write a program called vending.py that simulates a vending machine with respect to calculating change based...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program called vending.py that simulates a vending machine with respect to calculating change based on the amount paid. The program will accept as input the cost of the item purchased, and will prompt the user to add money until the cost is met/exceeded. It will then calculate and print the change. Assume that payments and change are given in R50, R20, R10, RS, R2, and R1 amounts. Sample 10: Enter the cost (in Rand): 21 Deposit a coin or note (in Rand): 10 Deposit a coin or note (in Rand): 20 Your change is: 1 x R5 2 x R2 NOTE: The program will calculate the minimum number of coins to give while making change. Write a program called vending.py that simulates a vending machine with respect to calculating change based on the amount paid. The program will accept as input the cost of the item purchased, and will prompt the user to add money until the cost is met/exceeded. It will then calculate and print the change. Assume that payments and change are given in R50, R20, R10, RS, R2, and R1 amounts. Sample 10: Enter the cost (in Rand): 21 Deposit a coin or note (in Rand): 10 Deposit a coin or note (in Rand): 20 Your change is: 1 x R5 2 x R2 NOTE: The program will calculate the minimum number of coins to give while making change.
Expert Answer:
Answer rating: 100% (QA)
Getting the cost of the item from the user cost intinputEnter the costin Ra... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Early in 2024, the Excalibur Company began developing a new software package to be marketed. The project was completed in December 2024 at a cost of $72 million. Of this amount, $48 million was spent...
-
Explain the meaning of the terms emoluments, employments and office for the purposes of PAYE as you earn systems. 2. Explain the actual receipts basis of assessing the emoluments from the employment...
-
Company Advertising ($ billions) Company Advertising (5 billions) A A 5.40 G 2.29 B 3.48 2.35 c 2.41 1 1.79 D 2.66 3 1.67 E E 2.24 K 2.36 F 2.44 L 1.58 (a) What the mean amount (in billion dollars)...
-
make a small case or use a situation/problem from real life. You will discuss this situation together with a discussion that works through a solution of your own to the problem posed. Problems or...
-
Show how butanoic acid may be converted to each of the following compounds: (a) 1-Butanol (e) Phenyl propyl ketone (b) Butanal (f) 4-Octanone (c) 1-Chlorobutane (g) 2-Bromobutanoic acid (d) Butanoyl...
-
Imagine working in a group with two other members asked by your boss to brainstorm names for a new product. The other two members stop after quickly generating 3-4 weak ideas and want to quit. One...
-
A batch of 200 laptops contains three defective laptops. You choose three laptops at random. What is the probability that you have (a) no defective laptops? (b) all three defective laptops? (c) two...
-
Jackie Wengler, owner of Wengler Home Decorating Service, has requested that you prepare from the following balances (a) An income statement for June 201X, (b) A statement of owner?s equity for June,...
-
Miller Company manufactures a line of lightweight running shoes. CEO Richard Miller estimated that the company would incur $7,000,000 in manufacturing overhead during the coming year. Additionally,...
-
Realist, Inc. (Realist), was a Delaware corporation with its principal place of business in Wisconsin. In March 1988, Royal Business Group, Inc. (Royal), a New Hampshire corporation, acquired 8...
-
A database approach uses different data models. Common database models include the relational model, the network model, and the hierarchical model. a) For all three common database models explain...
-
Examine Vikram Malik's monthly financial forecast Why do Guna's financial requirements vary across the year? What are the key determinants of Guna's borrowing needs?
-
Beethoven's Piano Rebuilding Company has been operating for one year. On January 1, at the start of its second year, its income statement accounts had zero balances and its balance sheet account...
-
Calculate the total interest on a mortgage paid monthly : Amount of loan = 225,024 Annual interest rate = 8% Length of loan = 20 years Round your answer to the nearest hundredth. Enter your answer as...
-
Prompt Your risk management and ethical analysis should analyze the prevalent risks associated with "Apple Inc" corporation, the challenges financial managers face in trying to attain short- and...
-
World Bridge Corporation manufactures a telecommunications device. During its first year of operations, the company started and completed 50 devices at a cost of $60,000 per unit. Of these, 48 were...
-
Your government is planning to build, equip and operate 111 hospitals across the country, dubbed Agenda 111 Programme. They intend to have the programme delivered in 1 year. As a Governance...
-
Explain five different cases of income exempt from tax with clear examples.
-
An entity can justify a change in accounting policy if a. The change will result in a reliable and more relevant presentation of the financial statements. b. The entity encounters new transactions...
-
When an entity chooses the revaluation model as its accounting policy for measuring property, plant, and equipment, which of the following statements is correct? a. When an asset is revalued, the...
-
China Petroleum and Chemical Corporation China Petroleum and Chemical Corporation (CPCC) is one of a growing number of Chinese companies that has cross-listed its stock on foreign stock exchanges. To...
-
Why is macroeconomic forecasting so difficult? Does this difficulty mean economics is a worthless field of study?
-
Which of the following statements are positive in nature and which are normative? a. A tax cut will raise interest rates. b. A reduction in the payroll tax would primarily benefit poor and...
-
a. Calculate the total percentage growth in average labor productivity in the U.S. economy for the 1950s, 1960s, 1970s, 1980s, 1990s, and 2000s. Define average labor productivity for any year as real...
Study smarter with the SolutionInn App