Pseudocode
Folien in diesem Satz (5)
-
- Pseudo code is a language used to define algorithms that is close to both English and program code
- once we have the flowchart to outline how the solution should work, we can start to turn this into a format we can code
- we can use pseudo code to define our algorithm in a format that will easily translate into program code, but which does not require to use the precise detail of the programming language
- The pseudo code simply outlines the steps in our program to achieve a working solution
-
- The algorithm:
- Input 2 numbers
- Output -- their total becomes:
- Input num1
- Input num2
- total := num1 + num2
- Output total
-
- The pseudo code defines the logic of the problem to be solved before we develop the actual code to solve the problem
- The pseudo code defines the structure for the actual code, but does not need to include all the syntax (rules) required by our programming language
- There is no formal standard for pseudo code but there are some conventions that are widely used
- It is normal practice to indent structures within the pseudo code to highlight them and show where they start and end
- line numbers are sometimes included so that it is easier to identify a section of the code
-
- Pseudo code
- Input num1
- Input num2
- Total := num1 + num2
- output total
- Code
- dim num1, total as integer
- Num1 = InputBox ("Enter first number")
- num2 = InputBox ("Enter second number")
- Total = num1 + num2
- console.writeline("value is", total)
Informationen
- Beschreibung
- GCSE Computer science (Chapter 7) Folienset am Pseudocode, erstellt von zharaadal99 am 11/02/2016.
- Erstellt von
- zharaadal99
- Aufrufe
- 2
- Bewertung