Module 1-1: App Design and Pseudocode
Designing an Application or Program
If I asked you to design and program an application from the ground up, what would you do? It seems like a daunting task, but we can break the process up into smaller steps that are much easier to accomplish. Here are 4 steps you can take to creating any new coding project:
- Define the problem, and how you plan to solve it.
- Outline the details of the problem and the programming tool you have to solve each step of the problem.
- Write pseudocode to create the starting code for your program
- Translate your pseudocode into Python code
What's Pseudocode?
Pseudocode is the description of the steps required in your program. It does not require any real format or key words, but instead is used to help design the logic of your program before coding it. You can write pseudocode in any way that will help you layout your code. Pseudocode is intentionally informal and is just for you to keep a note on how your program works.
Program Design Example: Math Quiz
Work through each step of the design process on your own to compare with the following example, or review the example first to learn more about how the process is used.
- Define a problem and how you will solve it.
- Problem: My 2nd grade sister needs to practice math and wants to use the computer.
- Solution: I can solve it by writing a program to ask math questions.
- Think about the details of how your solution might work. Then think about what each detail would require in Python.
- We can display output and take user input through the terminal
- We need to ask random math questions
- We need to know if our answer choice is correct or incorrect
- We want to ask questions until the user is finished
- We can start with only addition and add more later
- We can display output and take user input through the terminal
- Write pseudocode to execute the steps we outlined above.
This first example is more broad and natural language based, while the next example is based closely on Python. Either are perfectly valid.The natural language approach is easier to write, but harder to code, and the code based approach is harder to write, but easier to code. You can use comments at the top of your program to write your pseudocode with whatever style you prefer!
- Write python code based on your pseudocode.
Pseudocode by design is not complete code, so make sure you add imports and check spelling, spacing, and syntax. Read errors carefully for line numbers and double check the data type of inputs.