100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Essay

Python Program from Unit 6 (in text format) A2

Rating
-
Sold
-
Pages
2
Uploaded on
04-12-2017
Written in
2016/2017

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

Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Study Level
Examinator
Subject
Unit

Document information

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

Subjects

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)
$6.87
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached


Also available in package deal

Get to know the seller

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 Pearson
Follow You need to be logged in order to follow users or courses
Sold
32
Member since
9 year
Number of followers
26
Documents
28
Last sold
1 year ago

4.1

7 reviews

5
3
4
2
3
2
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right 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 aced it. It really can be that simple.”

Alisha Student

Frequently asked questions