0% found this document useful (0 votes)
323 views4 pages

COMPROG Flowchart For DCIT22.document

The document contains algorithms and flowcharts for 4 programs: 1) Determining if a number is even or odd. 2) Accepting a year level 1-4 and displaying the corresponding class (freshman, sophomore, etc.). 3) Accepting two numbers, performing a selected mathematical operation on them, and displaying the result. 4) Accepting three numbers, finding the highest and lowest, and displaying those values.

Uploaded by

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

COMPROG Flowchart For DCIT22.document

The document contains algorithms and flowcharts for 4 programs: 1) Determining if a number is even or odd. 2) Accepting a year level 1-4 and displaying the corresponding class (freshman, sophomore, etc.). 3) Accepting two numbers, performing a selected mathematical operation on them, and displaying the result. 4) Accepting three numbers, finding the highest and lowest, and displaying those values.

Uploaded by

Krish Ruivas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

1.

Accept a number and display if it is even or odd


Algorithm
 INPUT: number
 PROCESES: modulus division
 OUTPUT: even/odd

Flowchart

Start

number

Yes No
If number
%2 ===0

Display Display
EVEN ODD

Stop

DCIT22 COMPUTER PROGRAMMING 1 1


2. Accept year level and display the following:
1 – Freshmen
2 – Sophomore
3 – Junior
4 – Senior
Algorithm
 INPUT: 1-4
 PROCESS: a=1, a=2, a=3 and a=4
 OUTPUT: when 1 is placed in output it will appear freshmen.

Flowchart

Start

a = input1-4

No
Yes
a=1 Freshmen

No
Yes
a=2 Sophomore

No
Stop
Yes

Junior
a=3

No
Yes
Senior
a=4

invalid

DCIT22 COMPUTER PROGRAMMING 1 2


3. Create a flowchart that will accept 2 numbers, num1 & num2. Using the choices below, the program will
perform the chosen
Operation and display the answer:
1 – Addition
2 – Subtraction
3 – Multiplication
4 – Division
Algorithm
 INPUT: num1 and num2
 PROCESS: addition, subtraction, multiplication, division
 OUTPUT: sum, difference, product, quotient

Flowchart

Start

num1, num2

sum = num1 = num2


diff = num1 – num2
prod = num1 * num2
quo = num1 / num2

Sum, diff, prod, quo

Stop

DCIT22 COMPUTER PROGRAMMING 1 3


Accept 3 numbers and display the highest and lowest
Algorithm
 INPUT: 3 numbers, num1, num2 and num3
 PROCESS: using this
 OUTPUT: largest number and smallest

DCIT22 COMPUTER PROGRAMMING 1 4

You might also like