MAGON (INSTRUCTOR) Pseudocode- use to describe processes using natural language
Syntax- set of rules that defines
the combinations of symbols that are considered to be c or r ec tly structured document or fragment in that language Task- a basic unit of programming that an operating system control. Depending on how the operating system defines a task in its design, this unit on programming may be an entire program or each successive invocation of a program Variable- is a value that can change, depending on the conditions or on information passed to the program. Typically, a program consists of instructions that tell the computer what to do and data that the program uses when it is running. is a description of an algorithm or a computer program using natural language. The aim of pseudocode is to make reading program easier, some codes that are essential for human understanding are omitted. A simple way of writing programming code in English It is not actual programming language It uses short phrases to write code for programs before you actually create it in a specific language. Pseudocode makes creating programs easier. To use pseudocode, all you do is write what you want your program to say in English Allows you to translate your statements into any language because there are no special commands and it is not standardized. Remember, writing basic pseudocode is not like writing an actual coding language. It can be compiled or run like a regular program. Pseudocode can be written how you want. Syntax- a set of rules on how to use and organize statements in a programming language. § reduced complexity § increased flexibility § ease of understanding Step 1: Choose a Task § Choose a simple task to accomplish with your program Step 2: Write the Pseudocode § When writing the code, remember the following guide- lines: § The language should be universal § Limit each line to one task/ action § Capitalized all key words (even if not at the beginning of a sentence) § Indent loops (like if/then statements) § Don’t forget to start with “Start Program” and end with “End Program” 3. Test your code § After you have written your pseudocode program, put it aside for at least 1 day § When you are ready, try to follow your program exactly 3. Test your code § If you needed to do any trouble shooting, wait another day or two before testing your code again. § Alternatively, you can ask someone to attempt to complete your task following your pseudocode precisely. The programming process is a complicated one. You must first understand the program specifications. Then you need to organize your thoughts and create the program. You must break the main tasks that must be accomplished into smaller ones in order to be able to eventually write fully developed code. Writing Pseudocode will save you time later during the construction & testing phase of a program's development. (Algorithm for Classifying Student’s Grade)
If student’s grade is greater than or equal to 75
Print “Passed” else Print “Failed”
The example above is an algorithm of
determining whether a student with a specific mark should passed or failed. With the help of pseudocode, one can easily understand it without having to know the technicalities. 1. Create a program to add 2 numbers together and then display the result § Start program § Enter two number, A, B § Add the numbers together § Print Sum § End program 2. Compute the area of a rectangle § Get the length, l, and width, w § Compute the area= l*w § Display the area