Problem Description In this problem, you will write a program that allows users to buy specific bread. In this problem,

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Problem Description In this problem, you will write a program that allows users to buy specific bread. In this problem,

Post by answerhappygod »

Problem Description In This Problem You Will Write A Program That Allows Users To Buy Specific Bread In This Problem 1
Problem Description In This Problem You Will Write A Program That Allows Users To Buy Specific Bread In This Problem 1 (110.6 KiB) Viewed 21 times
Problem Description In this problem, you will write a program that allows users to buy specific bread. In this problem, you will add to your previous program so it can receive the user money to buy the desired bread. For each transaction you should know whether it is complete or incomplete. A completed transaction is possible if the user gives enough money and if there are enough bread items, and it should display the amount of change to return to the customer. An incomplete transaction can either be due to not enough bread, so return the client all their money. Or not enough money, so ask for more money to the client. Input You will receive (from the user) the following as input (in order): • The bread type ("white", "rye", "wheat"] • The quantity required by the customer (e.g., 4] • The amount that was paid by the customer (e.g., 20.00) • The cost of the item purchased by the customer (e.g., 15.99] • The province (e.g., "NS", "NB"] Processing 1. Calculate the cost of buying those breads. 2 Determine whether the bakery has enough items to complete the transaction. 3. Determine whether the client has enough money to buy the bread. 4. Determine whether the transaction can be completed or not. 5. Calculate the change the client will recieve. • if the client did not have enough money, ask for the remaining amount. o if there is not enough bread for the client, return the full amount the client gave. Examples Input Output White The cost to buy 5 white breads is 29.12 CAD. The tax is 3.12 CAD. 5 The client paid 30.00 CAD. TRANSACTION COMPLETE 30.00 We have enough white breads for the client to buy 5. 5.20 BC The client gave enough money to buy white breads. The client change is 0.88 CAD. Rye The cost to buy 10 rye breads is 71.19 CAD. The tax is 9.29 CAD. 10 The client paid 30.00 CAD. TRANSACTION INCOMPLETE 30.00 We do not have enough rye breads. 6.19 NS The client change is 30.00 CAD. The cost to buy 10 wheat breads is 37.03 CAD. Wheat The tax is 4.83 CAD. 10 The client paid 30.00 CAD. TRANSACTION INCOMPLETE 30.00 We have enough wheat breads for the client to buy 10 3.22 NS The client didn't give enough money to buy wheat breads. The amount due is 7.03 CAD.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply