For Teacher's Use Only Q No Total Q No Q No

Similar documents
Come and join us at WebLyceum

Collected By Anonymous

CS201 Latest Solved MCQs

Quiz Start Time: 09:34 PM Time Left 82 sec(s)

Come and join us at WebLyceum

Page. No. 1/15 CS201 Introduction to Programmming Solved Subjective Questions From spring 2010 Final Term Papers By vuzs Team

( Marks: 1 ) - Please choose one. && is operator. An arithmetic. Logical. Relational. Unary

CS201 Some Important Definitions

CS201- Introduction to Programming Current Quizzes

FINALTERM EXAMINATION CS201- Introduction to Programming

Short Notes of CS201

CS201 - Introduction to Programming Glossary By

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

Engineering Problem Solving with C++, 3e Chapter 2 Test Bank

CSc 10200! Introduction to Computing. Lecture 4-5 Edgardo Molina Fall 2013 City College of New York

Lecture 4 Tao Wang 1

1. Match each of the following data types with literal constants of that data type. A data type can be used more than once. A.

VuZs Team's Work. CS201 Spring Solved by vuzs Team with Reference Written by Administrator Wednesday, 19 May :52

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010


KOM3191 Object Oriented Programming Dr Muharrem Mercimek OPERATOR OVERLOADING. KOM3191 Object-Oriented Programming

Operator overloading

JAYARAM COLLEGE OF ENGINEERING AND TECHNOLOGY Pagalavadi, Tiruchirappalli (An approved by AICTE and Affiliated to Anna University)

1. Describe History of C++? 2. What is Dev. C++? 3. Why Use Dev. C++ instead of C++ DOS IDE?

An Object Oriented Programming with C

Final exam. Final exam will be 12 problems, drop any 2. Cumulative up to and including week 14 (emphasis on weeks 9-14: classes & pointers)

Object-Oriented Design (OOD) and C++

Week 8: Operator overloading

Jayaram college of Engineering and Technology, Pagalavadi. CS2203 Object Oriented Programming Question Bank Prepared By: S.Gopalakrishnan, Lecturer/IT

Dynamic Memory: Alignment and Fragmentation

CS304 Object Oriented Programming Final Term

SAURASHTRA UNIVERSITY

C++ 8. Constructors and Destructors

Objects and streams and files CS427: Elements of Software Engineering

Object-Oriented Programming for Scientific Computing

Module Operator Overloading and Type Conversion. Table of Contents


CS3157: Advanced Programming. Outline

7.1 Optional Parameters

Time : 3 hours. Full Marks : 75. Own words as far as practicable. The questions are of equal value. Answer any five questions.

Cpt S 122 Data Structures. Introduction to C++ Part II

CSCE 206: Structured Programming in C++

CSCE 206: Structured Programming in C++

l Determine if a number is odd or even l Determine if a number/character is in a range - 1 to 10 (inclusive) - between a and z (inclusive)

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor.

Getting started with C++ (Part 2)

7/8/10 KEY CONCEPTS. Problem COMP 10 EXPLORING COMPUTER SCIENCE. Algorithm. Lecture 2 Variables, Types, and Programs. Program PROBLEM SOLVING

Concepts Review. 2. A program is the implementation of an algorithm in a particular computer language, like C and C++.

! Determine if a number is odd or even. ! Determine if a number/character is in a range. - 1 to 10 (inclusive) - between a and z (inclusive)

Suppose we find the following function in a file: int Abc::xyz(int z) { return 2 * z + 1; }

CS250 Final Review Questions

Padasalai.Net s Model Question Paper

AN OVERVIEW OF C++ 1

Question 2. [5 points] Given the following symbolic constant definition

Object Oriented Programming. Solved MCQs - Part 2

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe

CSC1322 Object-Oriented Programming Concepts

For Final Term Exam Preparation by Virtualians Social Network

double d0, d1, d2, d3; double * dp = new double[4]; double da[4];

Venkateshwar International School Sector-18, Dwarka, New Delhi-78 SAT- PRELIMINARY ROUND Class XII

THE NAME OF THE CONSTRUCTOR AND DESTRUCTOR(HAVING (~) BEFORE ITS NAME) FUNCTION MUST BE SAME AS THE NAME OF THE CLASS IN WHICH THEY ARE DECLARED.

Largest Online Community of VU Students

Laboration 1 Introduction: matrices

Operator overloading: extra examples

Object Oriented Design

10. Abstract Data Types

BITG 1233: Introduction to C++

CS304 Object Oriented Programming

cs3157: c++ lecture #2 (mon-11-apr-2005) chronology of some programming languages... C++ vs Java identifiers.

Pointers and Arrays CS 201. This slide set covers pointers and arrays in C++. You should read Chapter 8 from your Deitel & Deitel book.

public : int min, hour ; T( ) //here constructor is defined inside the class definition, as line function. { sec = min = hour = 0 ; }

Pointers II. Class 31

C++ PROGRAMMING LANGUAGE: CLASSES. CAAM 519, CHAPTER 13

I/O Streams and Standard I/O Devices (cont d.)

CSCI-1200 Data Structures Spring 2016 Lecture 6 Pointers & Dynamic Memory

Ch02. True/False Indicate whether the statement is true or false.

CS 162, Lecture 25: Exam II Review. 30 May 2018

04-19 Discussion Notes

Chapter 2: Introduction to C++

C++ PROGRAMMING LANGUAGE: DYNAMIC MEMORY ALLOCATION AND EXCEPTION IN C++. CAAM 519, CHAPTER 15

Chapter 2: Special Characters. Parts of a C++ Program. Introduction to C++ Displays output on the computer screen

Reminder: compiling & linking

Chapter 15 - C++ As A "Better C"

CHAPTER 3 Expressions, Functions, Output

QUIZ. 1. Explain the meaning of the angle brackets in the declaration of v below:

C++_ MARKS 40 MIN

Understanding main() function Input/Output Streams

Interview Questions of C++

FORM 2 (Please put your name and form # on the scantron!!!!) CS 161 Exam II:

Practical C++ Programming

Declaring Pointers. Declaration of pointers <type> *variable <type> *variable = initial-value Examples:

CS250 Final Review Questions

Lecture 14. No in-class files today. Homework 7 (due on Wednesday) and Project 3 (due in 10 days) posted. Questions?

Chapter 2 Basic Elements of C++

Object Oriented Design

We can even use the operator << to chain the output request as:

C++ Programming: From Problem Analysis to Program Design, Third Edition

Common Misunderstandings from Exam 1 Material

Pointer Data Type and Pointer Variables

Transcription:

Student Info Student ID: Center: Exam Date: FINALTERM EXAMINATION Spring 2010 CS201- Introduction to Programming Time: 90 min Marks: 58 For Teacher's Use Only Q No. 1 2 3 4 5 6 7 8 Total Marks Q No. 9 10 11 12 13 14 15 16 Marks Q No. 17 18 19 20 21 22 23 24 Marks Q No. 25 26 27 28 29 30 31 32 Marks Q No. 33 34 35 36 Marks

Question No: 1 Operator overloading can be performed through. Classes Functions Operators Reference Question No: 2 When a value is referred by a normal variable then it is known as, Direct Reference Indirect Reference Partial Reference Proper Reference Question No: 3 Which of the following function is used to increase the size of already allocated memory chunk? malloc calloc

realloc free Question No: 4 Which of the following is NOT a preprocessor directive? #error #define #line #ndefine Question No: 5 The stream objects cin and cout are included in which header file? iostream.h fstream.h

istream.h ostream.h Question No: 6 Overloaded delete operator function takes the same parameter as an argument returned by new operator function. True False Question No: 7 When an array of object is created dynamically then there is no way to provide parameterized constructors for array of objects. True False Question No: 8 C is widely known as development language of operating system. Linux Windows Unix

Mac OS Question No: 9 Computer can understand only machine language code. True False Question No: 10 We can not define a function as a friend of a Template class. True False Question No: 11 What will be the value of a and b after executing the following statements? a = 3; b = a++; 3, 4 4, 4 3, 3 4, 3

Question No: 12 Consider the following code segment. What will be the output of following code? int addvalue (int *a){ int b = (*a) + 2; return b ; } main () { int x =6 ; cout << x <<, ; cout << addvalue(&x) <<, ; cout << x ; } 6,8,6 6,6,8 6,8,8 6,6,6 Question No: 13 is used to trace the logic of the program and correct the logical errors. Compiler Editor Linker Debugger

Question No: 14 new and delete are whereas malloc and free are. Functions, operators Classes, operators Operators, functions Operators, classes Question No: 15 Like member functions, can also access the private data members of a class. Non-member functions Friend functions

Any function outside class None of the given options Question No: 16 Which situation would require the use of a non-member overloaded operator? The overloaded operator is an Assignment operator. The left most operand is an object of a class. The left operand is built-in data type. The operator returns a reference. Question No: 17 The stream insertion and stream extraction operators are already overloaded for. User-defined data types Built-in data types User-defined and built-in data types None of the given options

Question No: 18 If we define an identifier with the statement #define PI 3.1415926 then during the execution of the program the value of PI. can not be replaced None of the given options Remain constant. can be changed by some operation Question No: 19 Assignment operator is -------------------------associative. right left binary unary Question No: 20

When ever dynamic memory allocation is made in C/C++, it is freed. Explicitly Implicitly Both explicitly and implicitly None of the given options Question No: 21 The appropriate data type to store the number of rows and colums of the matrix is. float int char none of the given options. Question No: 22 Which of the following function do NOT initialize the chunk of memory to all zero? calloc() function Both malloc() and calloc() None of the above malloc() function

Question No: 23 The function free() returns back the allocated memory got thorough calloc and malloc to. stack heap stack and heap None of the given options Question No: 24 width() is member function of cin object cout object Both cin and cout object None of the given option Question No: 25

Templates are not type safe. true false Question No: 26 A Matrix can be composed of ints, floats or doubles as their elements. Best way is to handle this, Write a separate class to handle each Use templates Use strings to store all types None of the given options Question No: 27 ( Marks: 2 ) Give the general syntax of class template. Question No: 28 ( Marks: 2 ) What is a truth Table? Question No: 29 ( Marks: 2 ) What will be the output of following code, if user input a number 123? int input ; cin >> oct >> input;

cout << hex << input ; Question No: 30 ( Marks: 2 ) What is principle of friendship in the context of functions and classes? Question No: 31 ( Marks: 3 ) What are the limitations of the friendship relation between classes? Question No: 32 ( Marks: 3 ) Suppose an object of class A is declared as data member of class B. (i) The constructor of which class will be called first? (ii) The destructor of which class will be called first? Question No: 33 ( Marks: 3 ) Define static variable. Also explain life time of static variable? Question No: 34 ( Marks: 5 ) Write a program which defines three variables of type double which store three different values including decimal points, using setprecision manipulators to print all these values with different number of digits after the decimal number. Question No: 35 ( Marks: 5 )

Let we have a class, class String { private: char buf[25]; }; Write code for assignment (=) operator function which assign one String object to other object. Your code should also avoid self assignment Question No: 36 ( Marks: 5 ) Read the given below code and explain what task is being performed by this function Matrix :: Matrix ( int row, int col ) { numrows = row ; numcols = col ; elements = new ( double * ) [ numrows ] ; for ( int i = 0 ; i < numrows ; i ++ ) { elements [ i ] = new double [ numcols ] ; for ( int j = 0 ; j < numcols ; j ++ ) elements [ i ] [ j ] = 0.0 ; } } Hint : This function belong to a matrix class, having Number of Rows = numrows Number of Columns = numcols