0% found this document useful (0 votes)
39 views2 pages

Midterm CE 116CP Batch 2021f

The document outlines the mid-term examination details for the CE-116: Computer Programming course at Sir Syed University, including the exam schedule, maximum marks, and specific questions covering topics such as Von Neumann Architecture, control units, program design, and C++ programming tasks. It consists of three main questions with sub-questions that assess understanding, application, and problem-solving skills in computer programming. The exam is scheduled for May 17, 2022, and is intended for 2nd semester BS Computer Engineering students.

Uploaded by

Mehar Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views2 pages

Midterm CE 116CP Batch 2021f

The document outlines the mid-term examination details for the CE-116: Computer Programming course at Sir Syed University, including the exam schedule, maximum marks, and specific questions covering topics such as Von Neumann Architecture, control units, program design, and C++ programming tasks. It consists of three main questions with sub-questions that assess understanding, application, and problem-solving skills in computer programming. The exam is scheduled for May 17, 2022, and is intended for 2nd semester BS Computer Engineering students.

Uploaded by

Mehar Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Undergraduate Mid-Term Examinations: Spring 2022

Sir Syed University of Engineering & Technology


Faculty of Electrical and Computer Engineering
Department of Computer Engineering
Mid Term Examinations (Spring 2022)

Course Code with BS Computer


CE-116: Computer Programming Program
Title Engineering
Instructor Jawaid Shabir Semester 2nd
Start date & Time May 17, 2022 End Time 11:00AM
at 09:30 AM
Maximum Marks 30

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++) }

(c) Predict the output of the following code? (04 Marks)


1) #include <iostream> 2) #include <iostream>
using namespace std; using namespace std;
int main() int main()
{ {
int grade = 100; int x = 1, y = 2;
if (grade > 60 && grade < switch(y){
100) case 1: cout << "one";
cout << "Pass"; case 2: cout << "two";
else default: cout << "three";
cout << "Fail"; }
} }

SSUET Page 1 of 2
Undergraduate Mid-Term Examinations: Spring 2022

Sir Syed University of Engineering & Technology


Faculty of Electrical and Computer Engineering
Department of Computer Engineering
Mid Term Examinations (Spring 2022)

Course Code with BS Computer


CE-116: Computer Programming Program
Title Engineering
Instructor Jawaid Shabir Semester 2nd
Start date & Time May 17, 2022 End Time 11:00AM
at 09:30 AM
Maximum Marks 30

3) #include <iostream> 4) #include <iostream>


using namespace std; using namespace std;
int main() int main()
{ {
int x = 1, y = 2; int x = 10;
cout << x - y + 3 * 4 / 5; cout << -- x + 1<<",";
} cout<< x++;
}

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)

for (i = 1; i <= 5 ; i++) cout << "*";


{ cout << endl;
for (j = 1; j <= i; j++) }

(d) Write C++ program to produce a triangular pattern of numbers using nested while loop,
get input from user. (03 Marks)

Output should be like this.

Enter the number of rows: 5


1
22
333
4444
55555

SSUET Page 2 of 2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy