Education In Pakistan

Papers, Notes, Books & Help For Students

UPDATED EDUCATIONAL NEWS INTERVIEW HELP FOR ALL JOBS ONLINE BOOKS SCHOLARSHIPS AVAILABLE INTERNSHIP JOBS

Tag: CS201-

MIDTERM PAPERS: Virtual University, VU, CS201 Introduction To Programming, All Past Years Midterm Papers

MIDTERM PAPERS: Virtual University, VU, CS201 Introduction To Programming, All Past Years Midterm Papers

Click Any Link To View Midterm Papers Of CS201

 

MIDTERM PAPERS: Virtual University, VU, CS201 Introduction To Programming, All Past Years Midterm Papers

VU CS201 – INTRODUCTION TO PROGRAMMING MIDTERM EXAMINATION (Session – 1 ) SPRING 2007

VU CS201 – INTRODUCTION TO PROGRAMMING MIDTERM EXAMINATION (Session – 1 ) SPRING 2007

www.Educational.pk

MIDTERM EXAMINATION

SPRING 2007 Marks: 50

CS201 – INTRODUCTION TO PROGRAMMING Time: 90min

(Session – 1 )

StudentID/LoginID: ______________________________

Student Name: ______________________________

Center Name/Code: ______________________________

Exam Date: Saturday, May 12, 2007

Please read the following instructions carefully before attempting any

of the questions:

1. Attempt all questions. Marks are written adjacent to each question.

2. Do not ask any questions about the contents of this examination

from anyone.

a. If you think that there is something wrong with any of the

questions, attempt it to the best of your understanding.

b. If you believe that some essential piece of information is

missing, make an appropriate assumption and use it to solve the

problem.

c. Write all steps, missing steps may lead to deduction of marks.

d. All coding questions should be answered using the Dev-C++/C ++

syntax.

e. Choose the most appropriate choice (among the given) while answering

the MCQs.

You are not allowed to use any compiler or IDE.

**WARNING: Please note that Virtual University takes serious note of

unfair means. Anyone found involved in cheating will get an `F` grade

in this course.

www.Educational.pk

For Teacher’s use only

Question 1 2 3 4 5 6 7 8 9 10 Total

Marks

Question 11 12 13 14

Marks

Question No: 1 ( Marks: 1 ) – Please choose one

Analysis is the ————– step in designing a program

Last

Middle

Post Design

First

Question No: 2 ( Marks: 1 ) – Please choose one

The remainder (%) operator is,

An arithmetic operator

A logical operator

A relational operator

A division operator

Question No: 3 ( Marks: 1 ) – Please choose one

When a call to function statement is encountered,

The control is transfer to its Prototype

The control is transfer to its definition

www.Educational.pk

The compiler stop execution of whole program

The program hangs

Question No: 4 ( Marks: 1 ) – Please choose one

In C/C++ language when an array is passed to a function then by default its passing

Mechanism is,

Call by value

It depends on type of array

Call by Reference

It depends on the return type of function.

Question No: 5 ( Marks: 1 ) – Please choose one

Computer can do,

More than what we tell it

Less then what we tell it

Like human being

Exactly what we tell it

Question No: 6 ( Marks: 1 ) – Please choose one

int x = 2 * 3 + 4 * 5;

What value will x contain in the sample code above?

22

www.Educational.pk

26

46

50

Question No: 7 ( Marks: 1 ) – Please choose one

In flow chart process is represented by

Rectangle

Arrow symbol

Oval

Circle

Question No: 8 ( Marks: 1 ) – Please choose one

Which one of the following will declare a pointer to an integer at address 0x22ff74 in memory?

int *x;

*x = 0x22ff74 ;

int *x = &0x22ff74;

int *x = *0x22ff74;

int *x( &0x22ff740 );

Question No: 9 ( Marks: 1 ) – Please choose one

www.Educational.pk

When we are using const keyword with a variable x then initializing it at the time of declaration is

Must

Optional

Not necessary

A syntax error

Question No: 10 ( Marks: 1 ) – Please choose one

int numarray[4][4] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};

What value does numarray [0][3] in the sample code above contain?

3

5

7

4

Question No: 11 ( Marks: 5 )

Write Header files for the functions,

i. sqrt();

ii. getline();

iii. printf();

iv. exit();

v. rand();

Question No: 12 ( Marks: 5 )

Write down the output of the following code?

www.Educational.pk

int array[7], sum = 0;

for(int i=0;i<7;i++)

{

array[i] = i;

sum+= array[i];

}

cout<< “ Sum = “ <<sum;

Question No: 13 ( Marks: 15 )

Write a program which consists of three variables Area, Per, Base, this program should find

and display the area of triangle using the formula,

Area = (Base * Per)/2 ;

Take the value of variables Per and Base from the user.

Question No: 14 ( Marks: 15 )

Write a function BalerAvgwhich calculate and display the average of a player ( Baler), call this

function in main program (function). Take input of runs given and ball delivered from the user in

main funciton.

The average may be calculated by the formula,

Average = (Total Runs given * 60) / (Total number of balls delivered);

VU CS201 – INTRODUCTION TO PROGRAMMING MIDTERM EXAMINATION (Session – 1 ) SPRING 2007

Vu CS201 Introduction to Programming Mid Term Examination Spring 2009 Solved/Unsolved

Vu CS201 Introduction To Programming Mid Term Examination Spring 2009 Solved/Unsolved

www.Educational.pk

CS201 Introduction to Programming

Mid Term Examination – Spring 2006

Time Allowed: 90 Minutes

Please read the following instructions carefully before

attempting any of the questions:

1. Attempt all questions. Marks are written adjacent to each

question.

2. Do not ask any questions about the contents of this

examination from anyone.

a . If you think that there is something wrong with any of the

questions, attempt it to the best of your understanding.

b . If you believe that some essential piece of information is

missing, make an appropriate assumption and use it to solve

the problem.

c . Write all steps, missing steps may lead to deduction of

marks.

d. All coding questions should be answered using the C++

syntax.

You are allowed to use the Dev-C++ compiler to write and test

your code. If you do so please remember to copy and paste your

code into the examination solution area. (Do NOT share your

code; your colleague could get higher marks than you!!)

**WARNING: Please note that Virtual University takes serious note of

unfair means. Anyone found involved in cheating will get an `F` grade in

this course.

Question No. 1 Marks : 10

Write the function definitions for the following:

www.Educational.pk

a) A function test() that would take three integer values x , yand z (as

parameters), find the largest and return the result to the calling function.

b) A function sum() that would take the one integer array myArray[ ] of size 10

(as parameter), calculate the sum of the elements of myArray[ ] and display

the result.

Note : The function sum() returns no value.

Question No. 2 Marks : 6

Write a program that will create and display the following series:

65, 44, 27, 14, 5, 0, -1, 2, 9, 20.

Hint:

The series is created by the formula 2x 2 – 3x

for x=-5 to 4

The variable x is of type integer.

Question No. 3 Marks : 2

The value of 2*15/3*7+3*2 is

146

76

8 70

Question No. 4 Marks : 2

Carefully analyze the following lines of code and chose the correct option.

ch1=”a”;

ch2=’a’;

ch1 and ch2 are strings

ch1 is string and ch2 is character

ch2 is string and ch1 is character

ch1 and ch2 are characters

Question No. 5 Marks : 2

The size of a double variable is

2 bytes

4 bytes

8 bytes

10 bytes

www.Educational.pk

Question No. 6 Marks : 2

An array is also called

an array variable

array declaration

struct

constant pointer

Question No. 7 Marks : 10

What will be the output of the following programs?

a) Program1

#include <iostream>

int main()

{

unsigned short x = 1;

for (int i = 0; i < 10; i++)

{

cout << x << endl;

x = x << 1;

}

return 0;

}

b) Program2

#include <iostream.h>

int main()

{

unsigned short x = 1024;

while(x>=1)

{

cout <<x << endl;

x =x >> 1;

}

return 0;

}

www.Educational.pk

Question No. 8 Marks : 6

Calculate the following expressions for

x=3 and y=2

1) ++x++*++y

2) 3*++x+–y

3) ++x*4*++y

Vu CS201 Introduction To Programming Mid Term Examination Spring 2009 Solved/Unsolved

Education In Pakistan © 2016