In: Computer Science
Post a Python program that accepts at least three values as input, performs some computation and displays at least two values as the result. The program must include an if statement that performs different computations based on the value of one of the inputs. Include comments in your program that describe what the program does. Also post a screen shot of executing your program on at least two test cases.
I would like to build a code along with these guidelines
Enter the area to tile: 30 Enter tile price ($ / sq. foot):
Would you like to include installation?
Yes Enter installation price ($ / sq. foot):
Your estimates: Tile cost: $300.00 Installation cost: $50.00 Total: $350.00
This program calculates annual expenses of a family by asking
*********************************************
Python program :
#This program calculates annual expenses of a family # by calculating monthly expenses #asking user monthy amount spent on groceries groceriesAmount=float(input("Enter monthly groceries amount : ")) #asking user monthly amount spent on vegitables and fruits vegitablesFruitCost=float(input("Enter monthly amount on fruits and vegitables : ")) #asking user amount spent on shopping shoppingCost=float(input("Enter amount spent on shopping : ")) #calculate total cost for month monthlyCost=groceriesAmount+vegitablesFruitCost+shoppingCost #calculate annual cost by multiplying 12 annualCost=monthlyCost*12 #calculate fixed cost per year as 20% of annualCost fixedCost=annualCost*0.20 #find total cost by adding fixedCost annual=annualCost+fixedCost #print details print("Monthly cost : $"+str(monthlyCost)) #print monthly cost print("Annual cost : $"+str(annualCost)) #print annual cost print("Fixed cost of 20% of annual cost : $"+str(fixedCost)) #print fixed cost print("Total Cost : $"+str(annual)) #print annual total ********************************************
Please refer to the screenshot of the code to understand the indentation of the code :
===========================================
Output :
Screen showing details :