Petrol costs £1.40 per litre. Diesel costs £1.55 per litre. LPG costs £0.95 per litre. Ask the user for which type of fuel their car uses and how much they have put into it. Calculate the correct price of the fuel they have taken. Ask how much money they have handed over and calculate the amount of change they are due. Finally, ask them if they have a loyalty card and if they do calculate how many points they should have added to it using the following – 1 point for every litre of fuel they’ve taken plus 1 point for every full pound they’ve paid. If the number of points they get is more than 100 they get a bonus 10% extra points.
python I need it now!!!!!!!!!!!!!1
Answers
while True:
print("1. Petrol")
print("2. Diesel")
print("3. LPG")
print()
c = int(input("Enter the choice you opt for: "))
print()
if c == 1:
l = int(input("Enter the amount of fuel you've taken [in litres]: "))
a = round(1.4*l, 2)
print(a, "is the total cost.")
print()
elif c == 2:
l = int(input("Enter the amount of fuel you've taken [in litres]: "))
a = round(1.55*l, 2)
print(a, "is the total cost.")
print()
elif c == 3:
l = int(input("Enter the amount of fuel you've taken [in litres]: "))
a =round(0.95*l,2)
print(a, "is the total cost.")
print()
m = int(input("Enter the amount handed over: "))
if m < a:
ch = a = m
print(ch, "pounds are due.")
else:
print("The full amount has been paid, thank you! :)")
print()
lc = input("Do you have a loyalty card? [Y/N]:")
if lc in "Yy":
if m == a:
p = (1*l) + (1*a)
print("Congratulations, you get", p, "points on your card.")
if p > 100:
bp = (0.10*p) + p
print("You also get a bonus of", 0.10*p, "points.")
print()
nc = input("Next customer? [Y/N]: ")
print()
if nc in "Nn":
break