Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using python 1. A bakery sells loaves of bread for $3.49 each. Day old bread is discounted by 60 percent. Write a program that begins
using python
1. 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 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. a. Write a function that calculates the total price of the bread. It should take the number of loaves as an input and return the total price. b. Make sure your input is an integer 2. Develop a program that reads a four-digit integer from the user and displays the sum of the digits in the number. For example, if the user enters 3141 then your program should display 3 + 1+ 4+ 1 = 9. a. Write a function that calculates the total. It should take the number as an input and return the sum of digits. b. Make sure your input is an integerStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started