You are on page 1of 3

Daffodil International University

Department of Computer Science & Engineering


Faculty of Science & Information Technology
Mid Term Examination, Semester: Fall- 2020
Course Code: CSE122 Course Title: Programming & Problem Solving
Section: PC-OLD & PC_Retake Level & Term: L1-T2 Course Teacher: MOT Total Marks: 25

Part – A (Converting into source code)


1. Convert the following flowchart into the source code: 3

2. Transform the Pseudo code into the C programing language: 3


Pseudo code
Procedure( )
for i=0 to n-1
if (A[i]= =item)
print “Item is Found”
exit
end if
end for loop
if (i>=n)
print “Item is not Found”
end if
end Procedure ( )
Part – B(Error Finding & Bug Fixing) 6

Find the error and fix the bug from the following codes-

Part – C(Code Writing) 3+2+2

1. Write a program that will print the numbers 10 to 55 which are completely divisible by the last digit of your
ID (if there is a 0 in the last digit, consider it as 13) and count the output integers.

Sample Output:
Divisible by Eight(8) : 16, 24, 32, 40, 48
Count: 5

2. Write a program that will calculate the distance from A to C for the given diagram.
3. Write a program that will calculate the area of the diagram if that is a triangle.

Part – D(Output Tracing) 6


For answering this segment create a box in your answer script and image that the box is your output window of the compiler.
Now write output for each code. **If you are ask to take input from user then the input will always be the last two digits of
your ID.**

You might also like