Question

In: Computer Science

Solve question by python Question: Day Old Bread A bakery sells loaves of bread for $3.49...

Solve question by python

Question: Day Old Bread
A bakery sells loaves of bread for $3.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
• The total price.
Reading input: 1 mark
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.
Declare the bread price and the discount amount as constants.
Include appropriate comments throughout your code including a header comment to briefly describe the purpose of your code.
Name your file: dayoldbread.py

Solutions

Expert Solution

#constants are declared

PRICE=3.65

DISCOUNT=0.6 #60%

#reading input from user

breds=int(input("Enter number of loaves of day-old bread: "))

#prining original and discounted price

print("Regular price ",PRICE)

print("Discounted Price ",(PRICE*DISCOUNT))

#printing total price

print("Total Price ",round(breds*(PRICE*DISCOUNT),2))


Related Solutions

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...
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...
An industrial bakery agrees to supply one hundred thousand loaves of bread monthly to a major...
An industrial bakery agrees to supply one hundred thousand loaves of bread monthly to a major Canadian grocery chain at a price of $1.00 per loaf. Before deliveries begin, the baker rethinks the deal, feeling it should have charged more. On review, it discovers that the contract recites “one hundred” loaves of bread monthly at $1.00 per loaf. What recourse will the grocery chain have if the bakery refuses to honour its price beyond 100 loaves?
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...
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.7 lb. and 3 oz., or 856 grams. Assume the standard deviation of the weights is 25 grams and a sample of 32 loaves is to be randomly selected. (A) This sample of 32 has a mean value of x, which belongs to a sampling distribution. Find the shape of this sampling distribution. a) skewed right...
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT