0% found this document useful (0 votes)
37 views6 pages

Cs201 Mid Spring2007 s1

The document is an exam for an Introduction to Programming course that contains 14 multiple choice and coding questions worth a total of 50 marks. It instructs students to attempt all questions, write all steps for coding questions, and warns that cheating will result in failure of the course. The questions cover topics like the steps of program design, arithmetic operators, function calls, array passing mechanisms, computer capabilities, simple math problems, flowcharts, pointers, constants, and 2 coding questions to write functions to calculate area of a triangle and average of a cricket player.
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)
37 views6 pages

Cs201 Mid Spring2007 s1

The document is an exam for an Introduction to Programming course that contains 14 multiple choice and coding questions worth a total of 50 marks. It instructs students to attempt all questions, write all steps for coding questions, and warns that cheating will result in failure of the course. The questions cover topics like the steps of program design, arithmetic operators, function calls, array passing mechanisms, computer capabilities, simple math problems, flowcharts, pointers, constants, and 2 coding questions to write functions to calculate area of a triangle and average of a cricket player.
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/ 6

WWW.VUPages.

com
http://forum.vupages.com
Largest Online Community of VU Students

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.
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


► 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
► 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


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?


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 BalerAvg which 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);

You might also like