question archive Write a program to get the number of stalls and stall details and calculate the total revenue of all the stalls
Subject:Computer SciencePrice:2.87 Bought7
Write a program to get the number of stalls and stall details and calculate the total revenue of all the stalls.calculate the stall cost for each stall each cost will be calculated by separate thread.Total revenue is the total cost of all stalls.Calculate the total revenue and display it
Answer:
CostS = 1000
CostM = 2000
CostL = 3000
Ns = float(input("Enter the no. of small size stalls: "))
Nm = float(input("Enter the no. of medium size stalls: "))
Nl = float(input("Enter the no. of large size stalls: "))
TotalS=0
TotalM=0
TotalL=0
if(Ns>0):
TotalS = Ns*CostS
print("\nTotal Cost of %.0f no. of Small sized Stalls = %.2f"%(Ns,TotalS))
if(Nm>0):
TotalM = Nm*CostM
print("\nTotal Cost of %.0f no. of Medium sized Stalls = %.2f"%(Nm,TotalM))
if(Nl>0):
TotalL = Nl*CostL
print("\nTotal Cost of %.0f no. of large sized Stalls = %.2f"%(Nl,TotalL))
TotalRevenue = TotalS + TotalM + TotalL
print("\n\nTotal Revenue of all stalls = %.2f"%(TotalRevenue))
Python Output:
>>>
RESTART: E:\CDAC_31_12_2017_Backup\CheggIndia_Anshu_Office\PythonCode\CheggPython.py
Enter the no. of small size stalls: 2
Enter the no. of medium size stalls: 3
Enter the no. of large size stalls: 4
Total Cost of 2 no. of Small sized Stalls = 2000.00
Total Cost of 3 no. of Medium sized Stalls = 6000.00
Total Cost of 4 no. of large sized Stalls = 12000.00
Total Revenue of all stalls = 20000.00
>>>