Nov-01-2018, 02:46 PM
(This post was last modified: Nov-01-2018, 02:46 PM by WarblingPasta.)
When I run it I have the problem in which the overall price always calculates as if the carpet is basic, so if I choose a luxury carpet the carpet price will be the same as if I have chosen basic. I have asked my teacher for help and they are unsure
This is my code:
This is my code:
#oneSquareMetre fitting price = £3.75 #One Square metre of basic is £6.50 #One Square metre of standard is £18.75 #One Square metre of luxury is £29.50 oneSquareMetre = float(3.75) print ("What type of Carpet do you want?") TypeOfCarpet = input() print ("What is the size of the room in Square Metres") SizeOfRoom = float(input()) FittingPrice = float(oneSquareMetre * SizeOfRoom) print ("Your fitting price in GBP is") print (FittingPrice) print ("Your overall price in GBP is") if ((TypeOfCarpet) == ("basic") or ("Basic")): CarpetCost = ((6.50) * SizeOfRoom) print (CarpetCost + FittingPrice) #print ((float(6.50) * SizeOfRoom)) elif ((TypeOfCarpet) == ("standard") or ("Standard")): CarpetCost = ((18.75) * SizeOfRoom) print (CarpetCost + FittingPrice) #print ((float(6.50) * SizeOfRoom)) elif ((TypeOfCarpet) == ("luxury") or ("Luxury")): print ((float(29.50) * SizeOfRoom))