Question

In: Computer Science

Exercise 5: Day Old Bread A bakery sells loaves of bread for £1.49 each. Day old...

Exercise 5: Day Old Bread A bakery sells loaves of bread for £1.49 each. Day old bread is discounted by 60 percent. Write a program that begins by reading the number of loaves of day old bread being purchased from the user. Then your program should display the regular price for the bread, the discount because it is a day old, and the total price. All of the values should be displayed using two decimal places, and the decimal points in all of the numbers should be aligned when reasonable values are entered by the user.

used : python

Solutions

Expert Solution

Python code:

#accepting the quantity
num=int(input("Enter the number of loaves of day old bread you wish to purchase: "))
#printing Regular price
print("Regular price: {:<5}£{:.2f}".format(' ',1.49*num))
#printing Discount
print("Discount: {:<11}£{:.2f}".format(' ',1.49*num*.6))
#printing Total price
print("Total price: {:<8}£{:.2f}".format(' ',1.49*num-1.49*num*.6))


Screenshot:


Input and Output:


Related Solutions

The number of loaves of bread sold per day by an organic bakery over the past...
The number of loaves of bread sold per day by an organic bakery over the past five years can be treated as a random variable that is normally distributed. This distribution has a mean of 77.5 and a standard deviation of 14.4 loaves. Suppose a random sample of 36 days has been selected. Determine the probability that the average number of loaves sold in the sample of days exceeds 80 loaves. First find the standard error of the mean. Now...
7. Loaves of bread in a certain bakery are approximately normally distributed with a mean length...
7. Loaves of bread in a certain bakery are approximately normally distributed with a mean length of 32 centimeters and a standard deviation of 2 centimeters. If a loaf is 34 centimeters long, how many standard deviation(s) is it from the mean? Show all work. (2 points) If a loaf is 28 centimeters long, how many standard deviation(s) is it from the mean? Show all work. (2 points) What percentage of the loaves are expected to be between 30 to...
The local bakery bakes more than a thousand 1-pound loaves of bread daily, and the weights...
The local bakery bakes more than a thousand 1-pound loaves of bread daily, and the weights of these loaves varies. The mean weight is 1.6 lb. and 4 oz., or 839 grams. Assume the standard deviation of the weights is 20 grams and a sample of 34 loaves is to be randomly selected. (a) This sample of 34 has a mean value of x, which belongs to a sampling distribution. Find the shape of this sampling distribution. skewed right approximately...
Suppose Andy can make 20 loaves of bread in a day, or 4 dresses in a...
Suppose Andy can make 20 loaves of bread in a day, or 4 dresses in a day. Write down his production possibilities frontier equation, and then graph it. Explain what the line itself represent, what the area under the line represents, and what the area above the line represents.
A bakery would like you to recommend how many loaves of its famous marble rye bread...
A bakery would like you to recommend how many loaves of its famous marble rye bread to bake at the beginning of the day. Each loaf costs the bakery ​$4.00 and can be sold for ​$5.00. Leftover loaves at the end of each day are donated to charity. Research has shown that the probabilities for demands of​ 25, 50, and 75 loaves are 30​%, 25​%, and 45​%, respectively. Make a recommendation for the bakery to bake​ 25, 50, or 75...
A bakery would like you to recommend how many loaves of its famous marble rye bread...
A bakery would like you to recommend how many loaves of its famous marble rye bread to bake at the beginning of the day. Each loaf costs the bakery $2.00 and can be sold for $7.00. Leftover loaves at the end of each day are donated to charity. Research has shown that the probabilities for demands of 25, 50, and 75 loaves are 35%, 20%, and 45%, respectively. Make a recommendation for the bakery to bake 25, 50, or 75...
Ask Your Teacher The local bakery bakes more than a thousand 1-pound loaves of bread daily,...
Ask Your Teacher The local bakery bakes more than a thousand 1-pound loaves of bread daily, and the weights of these loaves varies. The mean weight is 2 lb. and 3 oz., or 992 grams. Assume the standard deviation of the weights is 30 grams and a sample of 35 loaves is to be randomly selected. (b) Find the mean of this sampling distribution. (Give your answer correct to nearest whole number.) grams (c) Find the standard error of this...
Sally Artisan Bakery makes a variety of organic bread. The bakery is open every day from...
Sally Artisan Bakery makes a variety of organic bread. The bakery is open every day from 7 AM to 6 PM. At 4 PM each day, the bakery marks down its goods by 25%. It also offers a 10% discount every Sunday before 10 AM. Design a spreadsheet that displays the current date/time in one cell. Have your spreadsheet display the correct amount due when the user enters a sale amount, assuming no taxes will be charged.
Bakery A sells bread for $2 per loaf that costs $0.80 per loaf to make. Bakery...
Bakery A sells bread for $2 per loaf that costs $0.80 per loaf to make. Bakery A gives a 75% discount for its bread at the end of the day. Demand for the bread is normally distributed with a mean of 300 and a standard deviation of 30. What order quantity maximizes expected profit for Bakery A? a) 324.00 b) 300.17 c) 325.25
Carter Bakery bakes and sells bread at its retail outlets in Singapore. The average production and...
Carter Bakery bakes and sells bread at its retail outlets in Singapore. The average production and sales are 10,000 loaves per day. The company has the capacity to produce up to 15,000 loaves per day. The unit cost of production and selling (based on 10,000 loaves per day) is given below: Direct materials $0.40 Direct manufacturing labor 0.10 Variable manufacturing overhead 0.15 Fixed manufacturing overhead 0.35 Variable selling expense 0.05 Fixed selling expense 0.25 Total $1.30 The Bakery sells its...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT