Untitled

 avatar
unknown
python
5 months ago
1.7 kB
2
Indexable
import csv
import time

def readAircrafts():
    file1 = open("aircrafts.csv","r",newline = "")
    file_reader = csv.reader(file)
    
for rec in file_reader:
    for col in rec:
       print(loc,end = "")
        
    print("\n")

readAircrafts()
        


def readAirport():
    file2 = open("airport.csv","r",newline = "")
    reader_obj = csv.reader(file)

for rec in reader_obj:
    for col in rec:
        print(col,end = "")
        
    print("\n")

readAirport()



def main_menu():
    print("Welcome to the flight profit calculator")
    time.sleep(0.5)
    print("1. Enter airport details")
    time.sleep(0.5)
    print("2. Enter flight details")
    time.sleep(0.5)
    print("3. Enter price plan and calculate profit")
    time.sleep(0.5)
    print("4. Clear data")
    time.sleep(0.5)
    print("5. Quit")
    
    
main_menu()

while True:
    ch = int(input("Enter your choice"))
    if ch == 1:
        code = input("Enter the three letter UK airport code")
        if code not in ["LPL","BOH"]:
            print("Invalid airport code")
            main_menu()
        elif code in ["LPL","BOH"]:
            overseas_code = input("Enter the three letter overseas airport code")
            readAirport()#Read the CSV file here
            
    if ch == 2:
        aircraft = input("Enter the type of aircraft")
        if aircraft not in ["Medium Narrow Body","Large Narrow Body","Medium Wide Body"]:
            print("Invalid Aircraft type")
            main_menu()
        elif code in ["Medium Narrow Body","Large Narrow Body","Medium Wide Body"]:
            readAircrafts()
            #display details of the aircraft type
Editor is loading...
Leave a Comment