In: Computer Science
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
#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))