Simple Program and Execution Sheet
Learn to create a simple sequential program and execute it.
The process of problem solving
The four stages of problem solving are listed below:
- Analyze: Understand the available resources and constraints of a problem.
- Plan: Write the steps that solve the problem in the form of a program. This is the plan of action that will solve the problem.
- Implement: Execute a computer program to obtain the results.
- Evaluate: Match the results of the program with the desired output to determine success.
Simple language
One of the rules for good writing is to not repeat words. To ensure the readers enjoy what we write, we may use words with similar meanings instead of repeating them. For example, we may use any of the following similar but distinct phrases that mean roughly the same thing:
- Display on the screen
- Show on the monitor
- Print on the display unit
- Display
- Show
- Output on the screen
- Send to the screen
- Write to the console
However, we don’t want this type of fancy writing with multiple variations in our programs. We should select one simple way of saying something and use it the same way everywhere, even if we use it ten times in a single program.
Let’s say we pick “print” and use it to mean that we want to show something on the screen. We call this an instruction in the programming language. Similarly, we use “input” to mean that we want input from the user. We only use lowercase for these commands. Using a standardized vocabulary will help others understand our programs.
We’ll create a few simple programs using the above-mentioned simple programming language. Keep in mind that all programs are sequential and follow the instructions one by one in a sequence. We’ll also demonstrate the implementation of the programs with the help of the execution sheets.
Example programs
Let’s look at some example programs, starting simply and adding complexity.
Print the product
First, let’s create a program to display the product of and ...