KalleHallden / PythonProjects

203 stars 92 forks source link

Cybertron 7 python project test sample #22

Open Aditya3515-white-devil opened 1 year ago

Aditya3515-white-devil commented 1 year ago

import os import random import time import datetime import getpass def doremon(AI): for char in AI: print(char, end='', flush=True) time.sleep(0.005) doremon(" ") doremon("\n| /") doremon("\n| /") doremon("\n| _ /") doremon("\n / /") doremon("\n / /") doremon("\n / /") doremon("\n / /") doremon("\n / /") doremon("\n / /") doremon("\n / /") doremon("\n / /") doremon("\n / /") doremon("\n / /") doremon("\n / /") doremon("\n / /") doremon("\n / ___ /") print(" ||---------------||") print("\t\t || CYBERTRON ||") print("\t\t ||---------------||") time.sleep(1) os.system('clear')

def doremon(AI): for char in AI: print(char, end='', flush=True) time.sleep(0.0005) print()

def user(AI): for char in AI: print(char,end='',flush=True) time.sleep(0.0005) print() doremon("requesting to login for better experience") doremon("redirecting me to login page.") def design(): print("\t ||---------------||") print("\t || CYBERTRON ||") print("\t ||---------------||") print("\n\n\n\n\n")

users = { "":"", "99220040040@klu.ac.in":"99220040040", "99220040084@klu.ac.in":"99220040084" } trains = { "Delhi": ["12345-CyberA1 express"],
"Mumbai": ["12435-CyberA2 express"], "Hyderabad": ["12653-CyberA3 express"], "Bangalore": ["12678-CyberA4 express"], "Chennai": ["12987-CyberA5 express"], "Vijayawada": ["12239-CyberA6 express"], "Tirupati": ["12987-CyberA7 express"], "Bhopal": ["12390-CyberA8 express"], "Indore": ["12789-CyberA9 express"], "Madurai": ["12745-CyberA10 express"] }

flights = { "Delhi": ["Cybertron Airline 101 Time:6:00AM"],
"Mumbai": ["Cybertron Airline 201 Time:5:35PM"], "Hyderabad": ["Cybertron Airline 301 Time:6:20PM"], "Bangalore": ["Cybertron Airline 401 Time:8:00AM"], "Chennai": ["Cybertron Airline 501 Time:9:00AM"], "Vijayawada": ["Cybertron Airline 601 Time:3:00Am"], "Tirupati": ["Cybertron Airline 701 Time:4:20PM"], "Bhopal": ["Cybertron Airline 801 Time:2:35Pm"], "Indore": ["Cybertron Airline 901 Time:12:30pm"], "Madurai": ["Cybertron Airline 1001 Time:9:00Am"] }

PNR ={ "99220040040":"Mumbai--->vijayawada on 23-11-2024 seat number jl5" }

def table():

doremon("+----------------------+----------+-------+")
doremon("|        Flight        |  Class   | Price |")
doremon("+----------------------+----------+-------+")
doremon("| Cybertron Airline 101| Economy  |  5000 |")
doremon("| Cybertron Airline 101| Business | 10000 |")
doremon("| Cybertron Airline 201| Economy  |  7000 |")
doremon("| Cybertron Airline 201| Business | 15000 |")
doremon("| Cybertron Airline 301| Economy  |  6000 |")
doremon("| Cybertron Airline 301| Business | 12000 |")
doremon("| Cybertron Airline 401| Economy  |  8000 |")
doremon("| Cybertron Airline 401| Business | 16000 |")
doremon("| Cybertron Airline 501| Economy  |  9000 |")
doremon("| Cybertron Airline 501| Business | 18000 |")
doremon("| Cybertron Airline 601| Economy  |  4000 |")
doremon("| Cybertron Airline 601| Business |  8000 |")
doremon("| Cybertron Airline 701| Economy  |  5500 |")
doremon("| Cybertron Airline 701| Business | 11000 |")
doremon("| Cybertron Airline 801| Economy  |  4500 |")
doremon("| Cybertron Airline 801| Business |  9000 |")
doremon("| Cybertron Airline 901| Economy  |  6500 |")
doremon("| Cybertron Airline 901| Business | 13000 |")
doremon("| Cybertron Airline1001| Economy  |  7500 |")
doremon("| Cybertron Airline1001| Business | 15000 |")
doremon("+---------------------+----------+-------+")

def table1(): doremon("+--------+----------------+----------+-------+") doremon("\n|train no| Train | Class | Price |") doremon("\n+-------+---------------+----------+-------+") doremon("\n|12345 |CyberA1 express| AC | |") doremon("\n| | | sleeper | |") doremon("\n|---------|---------------|----------|-------|") doremon("\n|12435 |CyberA2 express| AC | |") doremon("\n| | | sleeper | |") doremon("\n|---------|---------------|----------|-------|") doremon("\n|12653 |CyberA3 express| AC | |") doremon("\n| | | sleeper | |") doremon("\n|---------|---------------|----------|-------|") doremon("\n|12678 |CyberA4 express| AC | |") doremon("\n| | | sleeper | |") doremon("\n|---------|---------------|----------|-------|") doremon("\n|12987 |CyberA5 express| AC | |") doremon("\n| | | sleeper | |") doremon("\n|---------|---------------|----------|-------|") doremon("\n|12239 |CyberA6 express| AC | |") doremon("\n| | | sleeper | |") doremon("\n|---------|---------------|----------|-------|") doremon("\n|12987 |CyberA7 express| AC | |") doremon("\n| | | sleeper | |") doremon("\n|---------|---------------|----------|-------|") doremon("\n|112390 |CyberA8 express| AC | |") doremon("\n| | | sleeper | |") doremon("\n|---------|---------------|----------|-------|") doremon("\n|12789 |CyberA9 express| AC | |") doremon("\n| | | sleeper | |") doremon("\n|---------|---------------|----------|-------|") doremon("\n|12745 |CyberA10express| AC | |") doremon("\n| | | sleeper | |") doremon("\n+---------+---------------+----------+-------+")

def pnr(): user_input=input("enter your PNR number:") if user_input in PNR: print("PNR STATUS:",PNR[user_input]) else: print("PNR invalid")
def reedem():

chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'

reedem_length = 9

reedem = ''.join(random.sample(chars, reedem_length))

return reedem 

def about(): print("CYBERTRON is a startup company specializing in AI and cybersecurity.Founded by Aditya, a visionary entrepreneur.") print("Aditya's vision for CYBERTRON was to leverage AI to solve complex problems in cybersecurity.\nCYBERTRON offers cutting-edge AI-driven solutions for detecting and preventing cyber attacks.") print("Aditya has created a culture of innovation and excellence within the company.") print("CYBERTRON is poised to become a leader in the AI and cybersecurity industry.") def seatnumber():

chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'

seat_length = 3

seat = ''.join(random.sample(chars, seat_length))

return seat 

def home(): time.sleep(0.005) doremon("Welcome to Cybertron AI services") doremon("1.flight booking\n2.train booking\n3.bus booking\n4.home")

selection = int(input("enter your choice:"))
if selection == 1:
    os.system('clear')
    design()
    flight()
elif selection == 2:
    os.system('clear')
    design()
    train()

elif selection == 3:
    print("bus reservation")
elif selection == 4:
    print("cybertron boat trip")
elif selection == 5:
    home()
else:
    print("invalid choice")
home()

def flight():

print("WELCOME TO CYBERTRON AIRLINES SERVICES")
print("1.FLIGHT BOOKING")   
print("2.ABOUT US")
print("3.back to home page")
user = input("enter your choice:")

if user == "2":
    about()
elif user=="1":
    print("POWERED BY CYBERTRON ")
    print(" ONE-WAY TRIP")
    dep = input("FROM: ")
    arr = input("TO: ")
    if dep in flights.keys() and arr in flights.keys():
        print("AVAILABLE FLIGHTS FROM", dep.upper(), "TO", arr.upper(), "ARE:", flights[dep])
        print("WOULD YOU LIKE TO PROCEED? (Y/N)")
        usp = input()
        if usp == "y":
            date = input("ENTER DATE OF TRAVEL (DD/MM/YY): ")
            table()
            amount = int(input("Enter amount for the ticket: "))

            print("Your ticket details are as follows:")
            print("Departure:", dep)
            print("Arrival:", arr)
            print("Date:", date)
            print("Amount:", amount)
            ssp = input("Would you like to proceed with the payment? (y/n): ")
            if ssp == "y":
               time.sleep(0.05)
               print("Requesting cybertron gateways to process the payment...")
               time.sleep(0.05)
               print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
               print("\t     CYBERTRON PAYMENTS")
               time.sleep(0.4)
               os.system('clear')
               print("\t     CYBERTRON PAYMENTS")
               print("redirecting to cybertron payments section")

               print("reedem code:", reedem())

               limit = 10

               for i in range(limit, 0, -1):
                  print("\r\033[k{i} seconds left", end="")
                  time.sleep(1)
                  continue
                  print("Payment successful!")
                  print("Your journey:", dep, "to", arr, "on date:", date)
                  print("Seat number:", seatnumber())
                  print("Thanks for using Cybertron Airlines services!")
                  print("Have a nice journey!")
                  print("for ticket cancellation")
                  print("contact: cybertron051222@gmail.com")

            else:
                print("Payment cancelled. Your booking is not confirmed.")
else:
    home()

def train():

print("WELCOME TO CYBERTRON RAILWAY SERVICES")
print("1.Train reservation")
print("2.PNR status")
print("3.ABOUT US")
print("4.back to home page")
t1= input("enter your choice:")

if t1 == "2":
   pnr()
elif t1=="1":
    print("POWERED BY CYBERTRON ")
    print(" ONE-WAY TRIP")
    dep = input("FROM: ")
    arr = input("TO: ")
    if dep in trains.keys() and arr in trains.keys():
        print("AVAILABLE Train FROM", dep.upper(), "TO", arr.upper(), "ARE:", trains[dep])
        print("WOULD YOU LIKE TO PROCEED? (Y/N)")
        isp = input()
        if isp == "y":
            today = datetime.date.today()

            input_date_str = input("Enter a date (in dd-mm-yyyy format): ")
            input_date = datetime.datetime.strptime(input_date_str, "%d-%m-%Y").date()

            if input_date < today:
                print("Invalid date entered. Date is in the past.")
            elif input_date == today:
                print("Booking in process for today.")
            else:
                print("Booking in process for future date.")

            date = input("ENTER DATE OF TRAVEL (DD/MM/YY): ")
            table1()
            amount = int(input("Enter amount for the ticket: "))

            print("Your ticket details are as follows:")
            print("boarding pass:", dep)
            print("to:", arr)
            print("Date:", date)
            print("Amount:", amount)
            Nsp = input("Would you like to proceed with the payment? (y/n): ")
            if Nsp == "y":
               time.sleep(0.05)
               print("Requesting cybertron gateways to process the payment...")
               time.sleep(0.05)
               os.system('clear')
               print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
               print("\t     CYBERTRON PAYMENTS")

               time.sleep(0.4)

               print("reedem code:", reedem())

               limit = 10

               for i in range(limit, 0, -1):
                  print(f"\r{i} seconds left", end="")
                  time.sleep(10)

               print("\nPayment successful!")
               print("Your journey:", dep, "to", arr, "on date:",input_date)
               print("Seat number:", seatnumber())
               print("for ticket cancellation:")
               print("contact: cybertron051222@gmail.com")
               print("Thanks for using Cybertron Airlines services!")
               print("Have a nice journey!!!!")

            else:
                print("Payment cancelled. Your booking is not confirmed.")

else:
    home()

def signup(): os.system('clear') design()

print("\t   ==== SIGN UP ====")
email = input("Enter email id:")

if email.endswith(("@gmail.com", "@klu.ac.in")):
    password = input("Enter password: ")

    users[email] = password
    print("User registered successfully!")
else:
    print("EMAIL NOT FOUND")

def login(): os.system('clear') design () print("\t ==== LOG IN ====") email_id = input("Enter email id : ") password = input("Enter password: ") if email_id not in users or users[email_id]!=password: print("Incorrect email or password") time.sleep(5) doremon ("login failed..,")

else:
    print("Login successful!")
    time.sleep(0.05)
    os.system('clear')
    home()

    flight()
    payment()
    reedem()

def exit(): os.system('clear') print("\n\n\n\n\n\n\n\n\n\n") design () print("\n\n\n\n\n\n\n\n\n") doremon ("THANKS FOR USING CYBERTRON AI SERVICES") print("powered by Cybertron") while True:

os.system('clear')
print("\t|---------CYBERTRON----------|")
print("\n\n\n")
print("\t1.Sign up")
print("\t\t2.Log in")
print("\t\t\t3.exit")
choice = input("enter your choice:")
if choice == "1":
    design()
    signup()
elif choice == "2":
    design ()
    login()

elif choice == "3":
    exit()
    break
else:
    print("Invalid choice!")