0% found this document useful (0 votes)
77 views3 pages

Daffodil International University: Department of Computer Science & Engineering

The document is the midterm exam for a Programming and Problem Solving course. It contains 4 parts: 1. Converting flowcharts into source code and pseudo code into C code. 2. Finding errors and fixing bugs in code snippets. 3. Writing code to print numbers divisible by the last digit of the student ID, calculate distance between points on a diagram, and calculate the area of a triangle diagram. 4. Tracing output by writing expected output in a box to simulate a compiler output window, using the last two digits of the student ID for any input asked from the user.

Uploaded by

Tuhin Sisir
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)
77 views3 pages

Daffodil International University: Department of Computer Science & Engineering

The document is the midterm exam for a Programming and Problem Solving course. It contains 4 parts: 1. Converting flowcharts into source code and pseudo code into C code. 2. Finding errors and fixing bugs in code snippets. 3. Writing code to print numbers divisible by the last digit of the student ID, calculate distance between points on a diagram, and calculate the area of a triangle diagram. 4. Tracing output by writing expected output in a box to simulate a compiler output window, using the last two digits of the student ID for any input asked from the user.

Uploaded by

Tuhin Sisir
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/ 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