#Question 4 - Using Functions

#creating a function
#defining a function
def entermeasurement():
    return float(input("Please enter measurement"))#establish what function returns to main body

print ("Please enter your parcel measurement as following: Length, Width, Height")
#function called 3 times to ensure the user enters all measurements 

#PRESENCE CHECKS WHEN INPUTTING MEASUREMENT VALUES

#LENGTH
Length = entermeasurement()
#presence check for length, to show a number lower than 0 will not be classed as a value
while (Length < 0):
    if (Length < 0):
        print("Invalid Input! Please re enter.")
        Length =  entermeasurement()

#WIDTH
Width = entermeasurement()
#presence check for width, to show a number lower than 0 will not be classed as a value
while (Width < 0):
    if (Width < 0):
        print("Invalid Input! Please re enter.")
        Width =  entermeasurement()

#HEIGHT       
Height = entermeasurement()
#presence check for height, to show a number lower than 0 will not be classed as a value
while (Height < 0):
    if (Height < 0):
        print("Invalid Input! Please re enter.")
        Height =  entermeasurement()

#Outputs measurements back to the user
print("The measurements you entered (length/width/height) were:" )
print(Length)
print(Width)
print(Height)
print (" ")

#the volume of parcel calculation
VolumeOfParcel = Length*Width*Height
#final output/display of result
print("The volume of the parcel is: " + str(VolumeOfParcel))
print("Please press enter to exit the program.")
