Computer Science, asked by xalxoarchbill, 10 months ago

ABC Airline Service Pvt. Ltd. has offered the following fare list for Delhi to Mumbai Class Fare Business Class Rs. 10000/- Economy Class Rs. 4000/- If a person wishes to avail in-flight meal services, she/he would be a charged and extra amount of Rs. 700/-. You are required to make a program in Python to find the amount a person needs to pay to travel from Delhi to Mumbai.

Answers

Answered by nayakpratham
1

Answer:

#Declare value for prices.

bprice = 10000 #Business class

eprice = 4000 #Economy

bwmprice = 10700 #Business with meal

ewmprice = 4700 #Economy with meal

print("Welcome to ABC Airline Booking Service.")

print("Which class would you like to travel in today?")

b_class = str(input("Business class? Enter Y for yes and N for no"))

proceedforB = "Y" or "y"

dproceedforB = "N" or "n"

if b_class == proceedforB:

   print("Alright!")

   mealA = str(input("Do you wish to avail our in-flight meal services? Enter Y for yes and N for no"))

   proceedforM = "Y" or "y"

   dproceedforM = "N" or "n"

   if mealA == proceedforM:

       print("Great!")

       print("Your final travel fare is {}".format(bwmprice))

       quit()

   elif mealA == dproceedforM:

       print("OK!")

       print("Your final travel fare is {}".format(bprice))

       quit()

elif b_class == dproceedforB:

   e_class = str(input("Would you like to travel in Economy class? Enter Y for yes and N for no"))

   proceedforE = "Y" or "y"

   dproceedforE = "N" or "n"

   if e_class == proceedforE:

       print("Alright!")

       mealB = str(input("Do you wish to avail our in-flight meal service? Enter Y for yes and N for no"))

       proceedforME = "Y" or "y"

       dproceedforME = "N" or "n"

       if mealB == proceedME:

           print("Great!")

           print("Your final travel fare is {}".format(ewmprice))

           quit()

       elif mealB == dproceedforME:

           print("OK!")

           print("Your final travel fare is {}".format(eprice))

           quit()

   elif e_class == dproceedforE:

       print("Thank you for using our program! Good bye!")

       quit()

else:

   print("You have entered an invalid answer. This program will now terminate!")

   quit()

Hope this helps!!

Similar questions