CSE 327
Final Assignment
Deadline: 19/04/2026
Question 1:
#include <stdio.h>
int main() {
int n;
printf("Enter number of numbers: ");
scanf("%d", &n);
int arr[n];
printf("Enter numbers:\n");
for(int i = 0; i < n; i++) {
scanf("%d", &arr[i]);
}
int i = 0;
int bigEven = 0, smallEven = 0, odd = 0;
while(i < n) {
if(arr[i] % 2 == 0) {
if(arr[i] > 50)
bigEven++;
else
smallEven++;
}
else {
odd++;
}
i++;
}
printf("\nBig Even: %d, Small Even: %d, Odd: %d\n",
bigEven, smallEven, odd);
return 0;
}
a) Draw the Control Flow Graph for the program.
b) Design 3 test cases for the program.
Question 2:
#include <stdio.h>
int main() {
int n;
printf("Enter number of values: ");
scanf("%d", &n);
int arr[n];
printf("Enter values:\n");
for(int i = 0; i < n; i++) {
scanf("%d", &arr[i]);
}
int div3 = 0, div5 = 0, others = 0;
for(int i = 0; i < n; i++) {
if(arr[i] % 3 == 0)
div3++;
else if(arr[i] % 5 == 0)
div5++;
else
others++;
}
printf("\nDivisible by 3: %d, Divisible by 5: %d, Others: %d\n", div3, div5, others);
return 0;
}
a) Draw the Control Flow Graph for the program.
b) List all independent paths.
c) Identify the operators and operands in the program above. Calculate the following
Halstead metrics: n1, n2, N1, N2, Vocabulary, Length, Program Volume, Effort,
Purity Ratio and Difficulty.
Question 3:
Apply the simple loop testing to find five test cases for the loop mentioned below:
int n = 5;
while (n <= 25) {
// Statements
n = n + 5;
}
Question 4:
BUBT is developing a Smart Employee Management System (EMS) to automate HR
tasks. Employees can view/update personal details, apply for leave, check salary
statements, and submit documents online. HR staff can manage employee records,
approve leave, process payroll, and generate reports. Management can monitor
attendance, track performance, and analyze trends. The system will be accessible via
web and mobile apps, hosted on BUBT’s cloud platform, developed using Angular,
Python (Django), and PostgreSQL, and will support multiple simultaneous users. The
project is scheduled from May to October with an estimated cost of $15,000. Identify
W5HH questions for this scenario and provide possible answers for each.