Unit 14
Source Code
# import animal class
# import dog class
# import employee class
# import programmer class
print("Unit 14")
myName = "" # add your name
print("Name: " + myName)
def main():
done = False
print("Main Menu")
print("E1 - Example 1")
print("Q - Quit")
while not done:
choice = input("Choice: ")
match choice:
# case for Example 1
case "E1":
example1()
# case for Example 2
case "E2":
example2()
# case for Quit
case "Q":
print("Quitting!")
done = True
# default case
case _:
print("Invalid, try again!")
# define Example 1 Function
def example1():
print("Example 1")
# create an animal
# create a dog
# define Example 2 Function
def example2():
print("Example 2")
# create an employee
# create an employee programmer
# displayInfo() from the Employee class
# displayProgrammerInfo() from the Programmer class
# call to main function, do not delete!
main()
animal.py
# header
# constructor
# method(s)
dog.py
# import
# header
# method
employee.py
# header
# constructor
# method(s)
programmer.py
# import
# header
# constructor
# method(s)
Last updated