CMPE113 Lecture3
CMPE113 Lecture3
Compute Output
Decision
S1: Start
S2: S 0, C0
S3: Input X
S4: S S + X
S5: C C+1
S6:If C<5, then go
to S3.
else print S
S7: Stop
10/10/2021 Asst. Prof. Dr. Damla Topallı 6
10/10/2021 Asst. Prof. Dr. Damla Topallı 7
Exp.1 Calculate Letter Grade
Write an algorithm and draw its
flowchart to find the letter grade of
a student’s grade out of 100.
13. stop
1.Start
2.Input three numbers (A, B, C)
3.Is A < B and A < C , display A is
Smallest, Go to Step 5
4.Is B < A and B < C, display B is
Smallest, Go to Step 5
5.Else display C is Smallest
6.Stop
10/10/2021 Asst. Prof. Dr. Damla Topallı 22
10/10/2021 Asst. Prof. Dr. Damla Topallı 23
Exp 4. Average of 25 Scores
Write the algorithm and draw the flowchart to calculate
the average from 25 exam scores
37
10/10/2021 Asst. Prof. Dr. Damla Topallı
Write and algorithm and draw a flowchart
to find the sum of odd integers from 1 to
99 inclusive.
1. Start
2. Sum = 0, number = 1
3. Sum = sum + number
4. Number = number + 2
5. If number less than 100 go to step 3
6. Print sum
7. Stop
N Show factorial
Calculate factorial