Structured Programming
SWE · Midterm · Summer 26
Paper 1 of 2By Pronoy Dass 261-35-XXX (P9)Switch
Paper 1 of 2
Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
Daffodil International University
Faculty of Science & Information Technology
Department of Software Engineering
Midterm Examination, Summer 2026
Course Code: SE 121; Course Title: Structured Programming
Sections & Teachers: A, B, C (MIR), D, E (MR), F, G, H (MNA), I (KRY)
Time: 1 Hour 30 Mins
Marks: 25
Answer ALL Questions
[The figures in the right margin indicate the full marks and corresponding course outcomes. All portions of each question must be answered sequentially.]
1. A treasure hunter discovers an old notebook containing the following steps: [Marks-5] CLO-1 Level-2
1. Start
2. Input the number of gold coins.
3. If coins are greater than 100, print "Rich".
4. Otherwise, print "Explorer".
5. Stop.
Answer the following:
a) Articulate whether the above sequence is an Algorithm or a Flowchart. Justify your answer with appropriate reasons. [2]
b) Compare flowcharts and programming code, and describe why flowcharts are generally easier to understand. [2]
c) Infer the flowchart symbol that should be used for the decision-making step in this problem. [1]
2. In a role-playing game, a character's overall power is determined by three attributes: Attack, Defense, and Speed. The game calculates the character's power using the following formula: [Marks-5] CLO-2 Level-3
Power = (Attack x 2) + (Defense x 1.5) + (Speed x 1.2)
Based on the calculated power value, the character is assigned one of the following ranks:
- Power >= 400 -> Legendary
- Power >= 300 -> Epic
- Power >= 200 -> Rare
- Otherwise -> Common
a) Construct a flowchart that illustrates the process of calculating the character's power and determining the corresponding rank. [Marks-5]
b) Classify the character into the appropriate rank category by writing a C program. [Marks-5]
Sample Input | Sample Output
Enter Attack, Defense, and Speed values respectively: 80 | Rank: Epic
60 |
50 |
3. a) A restaurant offers the following menu items: [Marks-5] CLO-3 Level-3
1. Burger - t200
2. Pizza - t450
3. Fried Chicken - t250
4. Grilled Chicken - t270
The customer enters a menu item number and the quantity ordered. The restaurant calculates the total bill based on the selected item and quantity.
Construct a restaurant bill calculator by writing a C program using a switch-case statement. If an invalid menu item number is entered, display "Invalid Menu Choice".
Sample Input | Sample Output
Enter the menu item number: 4 | Total bill amount: 810
Enter the quantity: 3 |
b) Code a C program for a college grading system where the system will provide the average grade based on the subject scores. The system has the following rules- [Marks-5]
a. Ask the user for n, where n is the number of subjects, n has to be greater than 2.
b. If an input score is less than 0 or greater than 100, the system will print "Invalid Score, Enter Again".
c. The system will take all the scores and give a grade on the average score following this grading system: 80-100 marks = A+, 70-79 marks = A, 60-69 marks = B, 50-59 marks = C, 40-49 marks = D, and 0-39 marks = F.
Sample Input | Sample Output
Number Of Subjects: 3 | Average Grade: B
Subject Scores: 78 62 59 |