Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You've been hired by Milk Lovers Grocery Store to write software to calculate and display the cost to a customer of buying milk. Write a

You've been hired by Milk Lovers Grocery Store to write software to calculate and display the cost to a customer of buying milk. Write a Python program to prompt for and read the following information from a clerk: Milk type (str) the type of milk purchased by the customer. The clerk only needs to enter a single-character code. You will need an if statement to determine which milk type the customer is buying. Use this table for the cost of each type: Milk code Milk type Cost per gallon w or W Whole $4.00 t or T 2% $3.50 s or S Skim $3.00 Number of gallons (int) the number of gallons of milk purchased by the customer. Output the following, one per line, with the label in one column and the value in another column: The two inputs (milk type should be spelled out) The cost of a gallon of milk The cost of the milk purchase (cost per gallon * number of gallons) Format the output so that the labels are left-justified in the first column and the numbers are right-justified in the second column. Format each number in the output to two decimal places. Here is a sample of the output: Milk Lovers Grocery Store ========================= Enter the milk type (w=whole; t=2percent; s=skim): s Enter the gallons: 6 Milk type purchased: Skim Gallons purchased: 6 Cost per gallon: $ 3.00 Total: $ 18.00 End of Milk Lovers Grocery Store

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

LO2 Identify components of workflow analysis.

Answered: 1 week ago

Question

305 mg of C6H12O6 in 55.2 mL of solution whats the molarity

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago