Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 1 out of 2 pages
Essay

Python Program from Unit 6 (in text format) A2

Document preview thumbnail
Preview 1 out of 2 pages

BTEC IT Level 3 Unit 6 Assignment 2 PROGRAM REQUIRED TO PASS

Content preview

#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)

Document information

Study Level
Subject
Uploaded on
December 4, 2017
Number of pages
2
Written in
2016/2017
Type
Essay
Professor(s)
Unknown
Grade
Unknown
$7.63

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
SNK0
4.1
(7)
Sold
32
Followers
26
Items
28
Last sold
2 year ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions