0% found this document useful (0 votes)
9 views14 pages

Pseudo Code and Flowchart Examples

The document contains pseudo code and flowcharts for various programming tasks, including calculating the sum of integers up to a given number, converting Fahrenheit to Celsius, summing a fixed number of inputs, printing a message multiple times, identifying if a number is positive or negative, and summing even numbers from 0 to 20. Each task is presented with a structured approach, detailing the steps required to achieve the desired output. The document serves as a guide for basic programming concepts and logic.

Uploaded by

Riezel Lucas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views14 pages

Pseudo Code and Flowchart Examples

The document contains pseudo code and flowcharts for various programming tasks, including calculating the sum of integers up to a given number, converting Fahrenheit to Celsius, summing a fixed number of inputs, printing a message multiple times, identifying if a number is positive or negative, and summing even numbers from 0 to 20. Each task is presented with a structured approach, detailing the steps required to achieve the desired output. The document serves as a guide for basic programming concepts and logic.

Uploaded by

Riezel Lucas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1

Start

SET sum = 0

WHILE
count < n
SET count = 2 YES NO

PROMPT "Enter a
Number" DISPLAY
Process 2 sum
sum = sum + count

INPUT n
End

INCREMENT
1
count

1. Write a pseudo code and flowchart for a program that


reads a integer n and then computes and prints the sum of
all integers between 1 and n.
1. Write a pseudo code and flowchart for a program that
reads a integer n and then computes and prints the sum of
all integers between 1 and n.
START
SET sum = 0
SET count = 2
PROMPT “Enter a Number”
INPUT n
WHILE count < n DO
COMPUTE sum = sum + count
INCREMENT count
DISPLAY sum
STOP
2. Write a pseudo code and flowchart
for a program that reads and converts a temperature value Start
from Fahrenheit
degrees to Celsius degrees.

PROMPT “Enter a
Fahrenheit “

Input F

Compute F - 32

Compute F × 5

Compute F ÷ 9

Display F

End
2. Write a pseudo code and flowchart
for a program that reads and converts a temperature value from Fahrenheit
degrees to Celsius degrees.

START
PROMPT “Enter a Fahrenheit “
Input F
Compute F - 32
Compute F × 5
Compute F ÷ 9
DISPLAY F
END
1. Find the sum of 7 and 19

START
Set number1 = 7
Set number2 = 19
Compute sum = number1 + number2
DISPLAY sum
STOP
1. Find the sum of 7 and 19 Start

number1 = 7

number2 = 19

sum = number1 + number2

Display sum

End
2. Find the sum of 5 numbers (base on number input)

start
SET sum = 0
SET i = 0
WHILE i < 5 DO
PROMPT for num
READ num
ADD num to sum
INCREMENT i
DISPLAY sum
STOP
2. Find the sum of 5 numbers (base on number input)
3. Print Hello World 6 times.

START
SET i = 0
WHILE i < 6 DO
PRINT “Hello World”
INCREMENT i
STOP
3. Print Hello World 6 times.
4. Identify either the number is positive or
negative (base on number input).

START
PROMPT for num
INPUT num
IF num > 0 THEN
PRINT "Positive"
ELSE num < 0
PRINT "Negative"
STOP
4. Identify either the number is positive or
negative (base on number input).
5. Add even numbers from 0 to 20.

START
SET sum = 0
SET i = 0
WHILE i <= 20 DO
ADD i to sum
INCREMENT i by 2
DISPLAY sum
STOP
5. Add even numbers from 0 to 20.

You might also like