Algorithms
Algorithms
Story
Characteristics
Parts
Phases
Perform the pseudocode that allows to enter two notes by keyboard, calculating the sum and
the product of the notes.
Program: Sumay product
Environment: NOTE1, NOTE2, SUM, PRODUCT are integers
Write "Enter the notes"
Read NOTE1, NOTE2
Calculate SUM = NOTE1 + NOTE2
Calculate PRODUCT = NOTE1 * NOTE2
Write "The sum of the two notes is:" SUM
Write "The product of the two notes is:" PRODUCT
Perform the pseudocode that lets you know if a number is greater, less than or equal to zero.
Program: Compare numbers
Environment: NUMBER is an integer
Type "Enter a number"
Read NUMBER
YES NUMBER> 0 THEN
Write "The number entered is positive"
YES NO YES NUMBER <0 THEN
Write "The number entered is negative"
IF NOT
Write "The number is zero"
Example of diagram N-S
The N-S diagrams are a mixture between the flowcharts and the
pseudocode.
Instead of the arrows are occupied rectangles placed in succession,
within each rectangle is placed the instruction in the form of
pseudocode or another set of rectangles or symbols to represent a
condition or cycle.