Advertisement
182days

(0478) 2016 Pre Task 2

Apr 25th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.31 KB | None | 0 0
  1. #input checker
  2. #prices
  3. #1-5 = 10$
  4. #0.1kg = 0.10$
  5.  
  6. a_parcel_count = 0
  7. r_parcel_count = 0
  8. total_weight = 0
  9. while True:
  10.     x = int(input("Enter the width of the parcel..."))
  11.     y = int(input("Enter the length of the parcel..."))
  12.     z = int(input("Enter the depth of the parcel..."))
  13.     w = int(input("Enter the weight of the parcel..."))
  14.     d = x + y + z
  15.     if x <=80 and y <=80 and z <=80 and d <=200 and w >=1 and w <=10:
  16.         print("Parcel Accepted!")
  17.         a_parcel_count = a_parcel_count + 1
  18.         total_weight = total_weight + (w)
  19.     else:
  20.         r_parcel_count = r_parcel_count + 1
  21.         print("Parcel rejected due to...")
  22.         if x >80:
  23.             print("Width too big")
  24.         if y >80:
  25.             print("Length too big")
  26.         if z >80:
  27.             print("Depth too big")
  28.         if d >200:
  29.             print("Dimensions too big")
  30.         if w <1:
  31.             print("Weight too light")
  32.         if w >10:
  33.             print("Weight too heavy")
  34.     print("\n")
  35.     print("------Consignment Summary---------")
  36.     print("Total number of accepted parcels is", (a_parcel_count))
  37.     print("Total number of rejected parcels is", (r_parcel_count))
  38.     print("Total consignment weight is", (total_weight), "kg")
  39.     print("------Consignment Summary---------")
  40.     print("\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement