Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

ST.

NICOLAS COLLEGE of BUSINESS & TECHNOLOGY


2nd Floor Mel-Vi Building, Jose Abad Santos Avenue, Dolores
City of San Fernando, Pampanga
Tel. No. (045) 861-3181

INFORMATION TECHNOLOGY DEPARTMENT

PRELIM EXAM IN DIT112 – COMPUTER PROGRAMMING 1

Instruction: Read and understand the problems and formulate the algorithms then draw the Flowchart

Example:

Problem: Create the algorithm and draw the flowchart that will print for area of the circle.

Algorithm: Flowchart:
1. Read Radius
2. Compute for the area using Area = 3.1416 *(Radius*Radius)
3. Print Area

Problem #1: Create the algorithm and draw the flowchart that will ask the user to
Enter a letter then identify if the letter is a vowel or a consonant

Problem#2: Create the algorithm and draw the flowchart that will ask the user to
Enter Three(3) Numbers then print the highest Number.

Problem#3: Create the algorithm and draw the flowchart that will ask the user to
Enter a number then print the sequence of numbers until it reaches the given
Number

Example:

Read Number: 5

Output: 12345
ST. NICOLAS COLLEGE of BUSINESS & TECHNOLOGY
2nd Floor Mel-Vi Building, Jose Abad Santos Avenue, Dolores
City of San Fernando, Pampanga
Tel. No. (045) 861-3181

INFORMATION TECHNOLOGY DEPARTMENT

Problem#1

Algorithm

Step 1: Start
Step 2: Read Letter
Step 3: If n==’a’ or n==’e’ or n==’i’ or n==’o’ or n==’u’ then
go to Step 4
else
go to Step 5
Step 4: Print ‘Letter is a vowel’ go to Step 6
Step 5: Print ‘Letter is Consonant’
Step 6: End

Flow Chart
START

READ
LETTER

IF LETTER = YES
PRINT
‘a’ or ‘e’ or ‘I’ ‘LETTER IS
or ‘o’ or ‘u’ VOWEL’

NO

PRINT
PROBLEM #2
‘LETTER IS A END
VOWEL’
ST. NICOLAS COLLEGE of BUSINESS & TECHNOLOGY
2nd Floor Mel-Vi Building, Jose Abad Santos Avenue, Dolores
City of San Fernando, Pampanga
Tel. No. (045) 861-3181

INFORMATION TECHNOLOGY DEPARTMENT

Algorithm

Step1: Start
Step 2: Read A,B, & C
Step3: If A>B AND A>C, then go to step 6
Step4: If B>A AND B>C, then go to step 7
Step5: If B>A AND B >C, then go to step 8
Step 6: Print A is greatest & go to step 9
Step 7: Print B is greatest & go to step 9 START
Step8: Print C is greatest
Step9: End

FLOW CHART
READ
A, B, C

YES
IF A>B PRINT A ‘IS
AND A>C HIEGHEST’

NO

YES
IF B>A PRINT B ‘IS
AND B>C HIGHEST’ END

NO

YES
IF B>A PRINT B ‘IS
AND B>C HIGHEST’

PROBLEM #3

ALGORITHM
ST. NICOLAS COLLEGE of BUSINESS & TECHNOLOGY
2nd Floor Mel-Vi Building, Jose Abad Santos Avenue, Dolores
City of San Fernando, Pampanga
Tel. No. (045) 861-3181

INFORMATION TECHNOLOGY DEPARTMENT

Step1: Start
Step2: Read Num
Step3: If Counter <= Num then
Num=Num+1
Go to Step 4
Step4: Print Num go to Step 3
Step5: End
Flow Chart

START

READ
Num

YES
IF Num = Num + 1
Counter<=
Num

PRINT
NO Num

END

You might also like