~ Create a main menu or start screen in Python


Sample Project - Netflix type system

*Teachers with subscriptions will have access to all worked solutions and python code. This sample project is based on OCR GCSE NEA Task 1

CHALLENGE: 

You've got to start somewhere right? This task simply requires you to create a start screen - the first thing a user will see. It should have a menu which includes login and registration, the two things the user can select from to start fakeflixing!

SUGGESTED SOLUTION / CODE: 

Note: See if you can do better (and you should be able to). The solutions provided are basic, and allow for discussion on possible alternative methods and solutions.

#Netflix type system demo - FakeFlix
import csv
import sys

def main():
   menu()


def menu():
    print("************Welcome to FakeFlix Demo**************")
    print()

    choice = input("""
                      A: Please Register
                      B: Login
                      Q: Logout

                      Please enter your choice: """)

    if choice == "A" or choice =="a":
        register()
    elif choice == "B" or choice =="b":
        login()
    elif choice=="Q" or choice=="q":
        sys.exit
    else:
        print("You must only select either A or B")
        print("Please try again")
        menu()

def register():
   pass
    
def login():
   pass
    
#the program is initiated, so to speak, here
main()

Remember Decomposition? Breaking the problem down?

Well, hopefully you've done that for the entire problem - have a read of the introduction and task again, if not. We have broken it down ourselves, but you may have a different method. Always try it yourself, before looking at the suggested answers

There is no one perfect way to solve a problem, but we're going to take you through a possible solution, and try it yourself to see if you can do better, for each step! 

The problem could be broken down into the following sub-problems. We are going to solve (or try to) each one:

1. Create a Login Screen

2. Create a Main Menu and define all the functions/sub programs needed in the program

3. Create a registration feature (need to save this to a file)

4. View all Student details (read from file)

5. Create a "Search by ID" feature

6. Create a "Produce Reports" feature

7. Search by Birthday (OR DOB) or Address feature (this is a report)

8. Create a report for Males and their emails

9. Create a report for all Females and their emails

10. Final Solution - reflect! How could you improve it? Test it!

Analyse

Write your own summary of the problem. What are your objectives? List the success criteria

Design Tools

Designing something or writing out some pseudocode before you actually write code is always a good idea! Get in to the habit of doing so! You can draw your flowchart here and screenshot it.

Try it yourself

Testing Table

You may want to read a little about Testing first. A teacher may go through some examples with you. Feel free to fill in the test table here, and screenshot it in to your powerpoint. Testing is absolutely essential once you have created a program!
Test No. Description Test Data(input) Expected Outcome Actual Outcome Further Action?
1
2
3
4
5
Coming soon!