#Date created 1/12/15
import os.path, time, sys #Used to import functions.
print ("Job Estimate tool Ver. 2.0, powered by Python 3.4.3")
while True: #Loop if user doesn't validate the data when promted.
print()
ID = str(input("Enter your name: ")) #Enter user name.
CID = str(input("Enter employer name: ")) #Enter Employers name.
print()
while True: #Loop for error handling.
try: #Used to run the program but when an error happens the program handles
it.
M = float(input("Enter Miles travelled: ")) #Miles.
H = float(input("Enter hours worked: ")) #Hours worked.
R = float(input("Enter resource cost: £")) #Resource cost.
DQ = (10* int(input("Enter discount (0 = 0%, 1 = 10% and 2 = 20%): ")))
#Discount.
if DQ == 0 or DQ == 10 or DQ == 20: #Return to previous point if
invalid option is enetered.
#Start of validateable data.
print()
print("User: ", ID)
print("Employer: ", CID)
print()
print ("Miles: ", (M))
print ("Hours: ", (H))
print ("Resources: ", (R))
print ("Discount: ", (DQ), "%")
print()
#End of validateable data.
YN = input("Are these details correct? Enter yes or no: ")
#Validation for data shown.
print()
if YN == "yes": #If data is validated.
#Start of calculations.
MR = round((M*2.5),2) #Milage.
HR = round((H*20),2) #Labour cost.
ST = round((MR+HR+R),2) #Sub-total.
D = round((ST*(DQ/100)),2) #Discount value.
DST = round((ST-D),2) #Discounted sub-total.
VAT = round((DST*0.2),2) #VAT
GT = round((DST+VAT),2) #Grand total
#End of calculations.
#Start of calculation output.
print ("Milage £", MR)
print ("Labour cost £", HR)
print ("Resource cost £", R)
print
("-------------------------------------------------------")
print ("Sub-total £",ST)
print
("-------------------------------------------------------")
print ("Discount £", D)
print ("VAT £", VAT)
print
("-------------------------------------------------------")
print ("Grand-total £", GT)
import os.path, time, sys #Used to import functions.
print ("Job Estimate tool Ver. 2.0, powered by Python 3.4.3")
while True: #Loop if user doesn't validate the data when promted.
print()
ID = str(input("Enter your name: ")) #Enter user name.
CID = str(input("Enter employer name: ")) #Enter Employers name.
print()
while True: #Loop for error handling.
try: #Used to run the program but when an error happens the program handles
it.
M = float(input("Enter Miles travelled: ")) #Miles.
H = float(input("Enter hours worked: ")) #Hours worked.
R = float(input("Enter resource cost: £")) #Resource cost.
DQ = (10* int(input("Enter discount (0 = 0%, 1 = 10% and 2 = 20%): ")))
#Discount.
if DQ == 0 or DQ == 10 or DQ == 20: #Return to previous point if
invalid option is enetered.
#Start of validateable data.
print()
print("User: ", ID)
print("Employer: ", CID)
print()
print ("Miles: ", (M))
print ("Hours: ", (H))
print ("Resources: ", (R))
print ("Discount: ", (DQ), "%")
print()
#End of validateable data.
YN = input("Are these details correct? Enter yes or no: ")
#Validation for data shown.
print()
if YN == "yes": #If data is validated.
#Start of calculations.
MR = round((M*2.5),2) #Milage.
HR = round((H*20),2) #Labour cost.
ST = round((MR+HR+R),2) #Sub-total.
D = round((ST*(DQ/100)),2) #Discount value.
DST = round((ST-D),2) #Discounted sub-total.
VAT = round((DST*0.2),2) #VAT
GT = round((DST+VAT),2) #Grand total
#End of calculations.
#Start of calculation output.
print ("Milage £", MR)
print ("Labour cost £", HR)
print ("Resource cost £", R)
("-------------------------------------------------------")
print ("Sub-total £",ST)
("-------------------------------------------------------")
print ("Discount £", D)
print ("VAT £", VAT)
("-------------------------------------------------------")
print ("Grand-total £", GT)