Midterm CE 116CP Batch 2021f
Midterm CE 116CP Batch 2021f
Q.No.1 (CLO_1): (Cognitive Level C2, i.e., Understanding) (PLO_1: Engineering Knowledge) (10 Marks)
(a) Explain Von Neumann Architecture Model with the help of diagram. (02 Marks)
(b) Explain Control Unit and its tasks. (02 Marks)
(c) Explain the program design process and its phases. (02 Marks)
Q.No.1
(d) Distinguish between range base for loop and traditional for loop with the help of syntax
and example. (02 Marks)
(e) Describe the difference in the meaning of int a[5] and the meaning of a[4]. Predict the
meaning of the [5] and [4] in each case? (02 Marks)
Q.No.2 (CLO_2): (Cognitive Level C3, i.e., Applying) (PLO_2: Problem Analysis) (10 Marks)
(a) Compute the output of the following program and also make changes in the following
program so that it uses a while loop in place of the for loop: (03 Marks)
#include <iostream> cout << "Enter max number";
using namespace std; cin >> max;
Q.No.1 int main() for(int i=max;i>=0;i--)
{ cout << i << "\n";
int max; }
(b) Predict the compiler errors (if there are any), find out the output of this code? (03 Marks)
#include <iostream > b[i]=3*i;
using namespace std for(int n=4; n>=0; n--);
int main() cout << b[n] << " ";
{ cout << endl
int b[5] return (0);
for(int i=0; i<5; i++) }
SSUET Page 1 of 2
Undergraduate Mid-Term Examinations: Spring 2022
Q.No.3 (CLO_3): (Cognitive Level C3, i.e., Applying)(PLO_3: Design/Development of Solution)(10 Marks)
(a) Create a user define function to compute the total cost of bulk purchase by using the data
given below. (02 Marks)
TaxRate = 0.05 (5%)
subTotal = quantity * price
Q.No.1 total = subTotal + subTotal * TaxRate
(b) Prepare a program in C++ to print 10 alphabets in reverse order by using an array.
(03 Marks)
Output should be like this.
Enter 10 letters: A B C D E F G H I J
JIHGFEDCBA
(c) Compute the output of the following syntax. What would be the output if we replace the
first for statement with the following? for (i = 5; i >= 1; i--): (02 Marks)
(d) Write C++ program to produce a triangular pattern of numbers using nested while loop,
get input from user. (03 Marks)
SSUET Page 2 of 2