BACHELOR OF INFORMATION TECHNOLOGY
SEMESTER 1/ MAY 2018
CBCP2101
COMPUTER PROGRAMMING I
MATRICULATION NO : 940203105903001
IDENTITY CARD NO. : 940203105903
TELEPHONE NO. : 01128132931
E-MAIL : erisyafrizal@gmail.com.my
LEARNING CENTRE : OUM Shah Alam
Table of contents Page
1.0 Problem Analysis 2
1.1 Input, constant and initial values
1.2 Execution process and programming technique
1.3 Output and presentation
2.0 Pseudo-code algorithm 3
3.0 Flowchart 5
4.0 Tracing Table 7
1
1.0 Problem Analysis
a) Input, constant and initial values
i. Number of student
ii. Number of courses
iii. Student Identification Number(ID)
iv. Marks
v. Total marks of each student
vi. Average marks of each student
b) Execution process and programming method
i. Execution process
a. Condition: Dual selection and multi-selection
b. Repetition structure: Counter controlled loop
c) Output and presentation
i. Grade: A, B, C, D, E and F
a. if (condition is TRUE): print “Grade: A/B/C/D/E/F”
ii. Total marks of each student
a. Calculate “total_marks = total_marks + marks”
Print “Total Marks = 1 + total_marks”
iii. Average marks of each student
a. Calculate “average_marks = total_marks/no_of _courses”
2
2.0 Pseudo-code algorithm
1.0 Start
2.0 Do
2.1 Display the menu
2.2 Input no. of student
2.3 Input no. of courses
2.4 Set StudentCount = 1
2.5 IF (StudentCount <= no. of student)
2.5.1 Input StudentCountID
2.5.2 Set CourseCount = 1
2.5.3 IF (CourseCount<= no. of course)
Input marks
IF (80<=marks<=100)
Print “Grade is A”
IF Else (70<=marks<=79)
Print “Grade is B”
IF Else (60<=marks<=69)
Print “Grade is C”
IF Else (50<=marks<=59)
Print “Grade is D”
IF Else (40<=marks<=49)
Print “Grade is E”
IF Else (marks<=39)
Print “Grade is F”
End_If
3
2.5.4 Calculate total_marks = total_marks + marks
2.5.5 Calculate average_marks = total_marks/ no_of_courses
2.5.5 Set CourseCount = CourseCount + 1
2.5.6 Set StudentCount = StudentCount + 1
2.5.7 IF (average_marks=> 40)
Start_If
Print “>>PROCEED TO THE NEXT SEMESTER…”
End_If
2.5.8 IF (average_marks<40)
Start_If
Print “FAILED”
End_If
2.5 End_For
3.0 End
4
3.0 Flowchart
Start
Input
no. of
student
Input
no. of
course
StudentCount = 1
False
StudentCount average_marks =
<= no. of total_marks / no_of_course
student
True
StudentCount =
Input
StudentCount + 1
Student
CountID
CourseCount = 1 CourseCount = CourseCount + 1
CourseCount False
<= no. of total_marks = total_marks + marks
course
True
Input Refer Flowchart 2.0
marks
5
End
Flowchart 1.0
Flowchart Grades
True
80<=marks
<=100 Grade = A
False
True
70<=marks
<=79 Grade = B
False
True
60<=marks
<=69 Grade = C
False Display
Grade
True
50<=marks
<=59 Grade = D
False
True
40<=marks
Grade = E
<=49
False True
marks<40 Grade = F
Flowchart 2.0
6
3.0 Tracing Table
no_Student no_Course no_Stude no_Courses student total_ average Final grades
s nt Count Count _marks marks _marks
3 3 1 1 56 56 56 -
3 3 1 2 45 101 50.5 -
3 3 1 3 89 190 63.33 C
3 3 2 1 40 40 40 -
3 3 2 2 60 100 50 -
3 3 2 3 80 180 60 C
3 3 3 1 50 50 50 -
3 3 3 2 70 120 60 -
3 3 3 3 90 210 70 B
Tracing Table 1.0
7
INSTRUCTIONS
Do not copy the assignment question and instructions to your answer.
Prepare your assignment answer following the layout of the ASSESSMENT
CRITERIA shown in the RUBRICS provided for the course. Where RUBRICS are
not provided, follow the instructions/guidelines specified by the Open University
Malaysia (OUM) for the assignment concerned.
Your assignment should be written according to the number of words outlined in
the assignment instruction EXCLUDING references.
Type your answer using 12 point Times New Roman font and 1.5 line spacing.
Show the number of words at the end of your assignment.
Tables and figures where provided, should be appropriately titled.
List your references separately in the APPENDIX page.
8
ATTACHMENT
REFERENCES
Author’s name (year). Book, Title, Publication