Theory Assignments-3. Theory Assignments-4

Similar documents
PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

C++ INTERVIEW QUESTIONS

Subject Name: Object Oriented Programming in C++ Subject Code:

Object Oriented Programming With C++(10CS36) Question Bank. UNIT 1: Introduction to C++

The C Programming Language course syllabus associate level

13 Classes & Objects with Constructors/Destructors

ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology)

I PUC - Computer Science. Practical s Syllabus. Contents

BCS2B02: OOP Concepts and Data Structures Using C++

Glossary of Object Oriented Terms

Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies)

El Dorado Union High School District Educational Services

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

WORKSPACE WEB DEVELOPMENT & OUTSOURCING TRAINING CENTER

An Incomplete C++ Primer. University of Wyoming MA 5310

Object Oriented Software Design II

Programming in C# with Microsoft Visual Studio 2010

Chapter 4 OOPS WITH C++ Sahaj Computer Solutions

Laboratory Assignments of OBJECT ORIENTED METHODOLOGY & PROGRAMMING (USING C++) [IT 553]

C++ Programming Language

C++ Overloading, Constructors, Assignment operator

C++FA 5.1 PRACTICE MID-TERM EXAM

Curriculum Map. Discipline: Computer Science Course: C++

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas

Polymorphism. Problems with switch statement. Solution - use virtual functions (polymorphism) Polymorphism

Java Interview Questions and Answers

IS0020 Program Design and Software Tools Midterm, Feb 24, Instruction

CpSc212 Goddard Notes Chapter 6. Yet More on Classes. We discuss the problems of comparing, copying, passing, outputting, and destructing

10CS35: Data Structures Using C

Sources: On the Web: Slides will be available on:

Operator Overloading. Lecture 8. Operator Overloading. Running Example: Complex Numbers. Syntax. What can be overloaded. Syntax -- First Example

Syllabus for Computer Science. Proposed scheme for B.Sc Programme under Choice Based Credit System

Illustration 1: Diagram of program function and data flow

CEC225 COURSE COMPACT

Objected oriented Programming: C++ Unit 1 1. Introduction 1.1. Introduction to Object Oriented Programming C++ fundamentals.

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner.

Basics of I/O Streams and File I/O

Introduction to Programming Block Tutorial C/C++

TECHNOLOGY Computer Programming II Grade: 9-12 Standard 2: Technology and Society Interaction

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Habanero Extreme Scale Software Research Project

1 bool operator==(complex a, Complex b) { 2 return a.real()==b.real() 3 && a.imag()==b.imag(); 4 } 1 bool Complex::operator==(Complex b) {

Introduction to C++ Introduction to C++ Week 7 Dr Alex Martin 2013 Slide 1

Programming and Software Development (PSD)

Syllabus OBJECT ORIENTED PROGRAMMING C++

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship.

Specialized Android APP Development Program with Java (SAADPJ) Duration 2 months

Advanced Data Structures

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C

C++ Crash Kurs. C++ Object-Oriented Programming

Java Programming Fundamentals

Ch 7-1. Object-Oriented Programming and Classes

1.1.3 Syntax The syntax for creating a derived class is very simple. (You will wish everything else about it were so simple though.

ADVANCED SCHOOL OF SYSTEMS AND DATA STUDIES (ASSDAS) PROGRAM: CTech in Computer Science

Java (12 Weeks) Introduction to Java Programming Language

Binary storage of graphs and related data

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007

Java Application Developer Certificate Program Competencies

CS193D Handout 06 Winter 2004 January 26, 2004 Copy Constructor and operator=

B.Sc.(Computer Science) and. B.Sc.(IT) Effective From July 2011

UNIVERSITY OF CALIFORNIA BERKELEY Engineering 7 Department of Civil and Environmental Engineering. Object Oriented Programming and Classes in MATLAB 1

JAVA - QUICK GUIDE. Java SE is freely available from the link Download Java. So you download a version based on your operating system.

OpenCL Static C++ Kernel Language Extension

C Interview Questions

Course notes Standard C++ programming

Introduction to Java

Chapter One Introduction to Programming

C++ Language Tutorial

COMPUTER SCIENCE. 1. Computer Fundamentals and Applications

CISC 181 Project 3 Designing Classes for Bank Accounts

Classes and Objects in Java Constructors. In creating objects of the type Fraction, we have used statements similar to the following:

Lecture 3. Arrays. Name of array. c[0] c[1] c[2] c[3] c[4] c[5] c[6] c[7] c[8] c[9] c[10] c[11] Position number of the element within array c

Basics of C++ and object orientation in OpenFOAM

Moving from CS 61A Scheme to CS 61B Java

CS 111 Classes I 1. Software Organization View to this point:

COMPUTER SCIENCE 1999 (Delhi Board)

J a v a Quiz (Unit 3, Test 0 Practice)

ASCII Encoding. The char Type. Manipulating Characters. Manipulating Characters

Simple C++ Programs. Engineering Problem Solving with C++, Etter/Ingber. Dev-C++ Dev-C++ Windows Friendly Exit. The C++ Programming Language

Object Oriented Software Design

Contents. 9-1 Copyright (c) N. Afshartous

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands

Tutorial on C Language Programming

Chapter 6: Programming Languages

Java Crash Course Part I

Course Title: Software Development

Description of Class Mutation Mutation Operators for Java

Application Note C++ Debugging

Object Oriented Software Design

AP Computer Science Java Subset

More C++ Concepts. Operator overloading Friend Function This Operator Inline Function

Chapter 5 Names, Bindings, Type Checking, and Scopes

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

Pemrograman Dasar. Basic Elements Of Java

Compiler Construction

Stacks. Linear data structures

Transcription:

Prof. Ramkrishna More Arts, Commerce & Science College S.Y.B.Sc.(Computer Science) Subject Object oriented concepts & programming in C++. Theory Assignments-1 Q.1) Answer the following.(1m) 1. List any 2 languages other than C++,which support object oriented programming concepts. 2. What do you mean by late binding. 3. State any one advantages of object oriented programming over procedure oriented programming. 4. Explain the following a)polymorphism (b) Date Encapsulation. Theory Assignments-2 1. Explain any two access specifiers. 2. Why you need a scope resolution operator to access global variable? 3. What are manipulators?explain any two manipulators with example. 4. C++ is a pure object oriented Language, justify true or false. 5. Which bit must be turned on to print member along with + sign. 6. Why do reference variable have to be initialized? 7. State syntax to create a reference variable. 8. Write the C++ statement to free the memory allocated by following statement. int *p=new int(10); 9. List any 2 features of C++ programming language. 10. Give the syntax for explicit type conversion of a variable or expression in C++. 11. Explain any two predefine manipulators. 1. Write a macro in C++ to find the maximum of 2 positive integers. 2. What is memory management operator?explain the operator new with example. 3. Give any two advantages of new over malloc. 4. Write menu driven program in C++ to calculate the area of circle and rectangle. 5. Write a program to input a single character through keyboard & print its ASCII value and Hexadecimal value. 6. Trace the output of the following. Class sample Private:Static int cnt; Public: sample()++cnt; Void display()cout<< cnt= <<cnt; Int sample::cnt=0; Void main() sample S1,S2,S3,S4; S4,display();

Theory Assignments-3 1. Explain array of object. 2. How does class declaration differ from class definition? 3. Write C++ statement to allocate memory dynamically for an array of 10 points to object of some class,say A. 4. Why can t initialize members within class. 5. How does class achieve data hiding? 6. What are objects?how are they created? 7. Class members are public by default.justify(t/f). Theory Assignments-4 1. List the functions of istream class. 2. What will be the output of the following C++ statement. Cout.precision(2); Cout.width(6); Cout<<7.1234; 1. Explain C++ stream classes. 2. What is a manipulator?write manipulator called currency which display Rs. when output is called. Theory Assignments-5 1. Justify true/false. a) In procedure oriented programming all data items are shared by all functions. b)function can not return class object. 2. Give two methods,which are,used it defined member function. 3. What is inline function? 4. What is function overloading? 5. What is difference between inline function & normal function? 6. What are disadvantages of inline function? 7. Why can t static member function access non-static member class? 8. State the reason why we cannot use the this pointer in a friend function. 9. A function can return value by references.comment. 10. Give the syntax to create reference variable. 11. Explain friend function with example. 1. What is function overloading? Explain with example. 2. Explain static data member and static member functions with the help of suitable example. 3. What is inline function? how does it differ from regular function? State one advantages & disadvantage of using inline function. 4. Explain call by reference and return by reference with example. 5. What is friend function? What are advantages & disadvantages of friend function.

6. Write a program to find GCD of two positive integer using function. Theory Assignments-6 1. Justify true/false :destructor takes input parameter. 2. What is constructor? Is it mandatory to use destructor in class? 3. How many time will constructor of class student be invoked for the following statement. Student s,*p; 4. Find the error in following code. class NUMBER int a; void NUMBER(int x=0) a=x; 1. Define a constructor. Explain the copy constructor & parameterize constructor with example. 2. Trace the output of following program : a) Class Wilma public: Wilma() cout<< Wilma cnt\n ; Void f() cout<< Wilma used\n ; Class Fred public: Fread() cout<< Fred cnt\n ; Protected : Static Wilma Wilma_; Fred f; Wilma Fred::Wilma_; Main() b) class A public : A()cout<< Cnt\n ; ~A()cout<< Dstr\n ; A a1,a2; main() A a3,a4,a5; int i=0; if(i) A a6; else exit(1); A a7;

c) class X public: X() cout<< default cnt\n ; X(const X&) cout<< copy constructor\n ; X UserCode(X b) X c=b; return c; main() X a; cout<< calling user code()\n ; X d=usercode(a); cout<< Back in main()\n ; d) class Table Public: Table() cout<< cnt \n ; ~Table() Cout<< Dstr\n ; Table t1; Table t2=t2; Table t3; main() t3=t2; Theory Assignments-7 1. List the operator which cannot be overloaded.

2. If unary operator is overloaded as a member function,how many implicit & explicit arguments does it require? 3. Which operator must be overloaded as member (not friend )function? 4. Write the syntax for overloading << operator. 1. Explain this pointer with suitable example. 2. What is polymorphism?how polymorphism is achieve in C++?Explain any one polymorphism with suitable example. 3. Write a program in C++ using operator overloading to print n terms of fibonacci series. 4. Define class string.use overloaded operator == to compare two strings. 5. Write program to multiply two matrices.let m1 and m2 are two matrices.find out m3=m1*m2(use operator overloading). 6. Define a class matrix with necessary members. Overload operator + as friend function to add 2 matrices. Also write main() to test this function. Theory Assignments-8 1. List the types of inheritance. 2. Justify true/false: a) Can base class object access member of driven class. b) A base class is never used to create objects. c) Operator overloading is an example of run time polymorphism. d) A class containing virtual function cannot be instantiated. e) Overloading means the use of same name function to the more than one function. 3. What do you mean by virtual destructor? 4. What happens is a derived class fails to explicitly provide arguments to the base class constructor. 5. When do you make class virtual. 6. State the use of protected access identifier. 7. In what order constructors are invoked in multilevel inheritance? 8. Define : pure virtual function. 1. Explain public and private inheritance with example. 2. What is pure virtual function?what are the implementations of making a pure virtual function? 3. What is inheritance?explain multiple and hierarchical inheritance with example. 4. What do you mean by protected access specifiers? Explain protected deviation in detail. 5. What is containership?how does it differ from inheritance? 6. What do you mean by virtual base class and abstract base class? Explain with example. 7. Write short note on constructor in derive class. 8. Create a class vehicle having two private members (vehicle no,,owner name).derive a class two-wheeler having private member (type I.e. scooter/bike).define functions accept and display in both classes. Write a main function to accept detail of two wheelers.(i.e. vehicle name, owner name, type).

Theory Assignments-9 1. Differentiate seekg() and seekup() function. 2. For what purpose,fstream is used? 3. Which class define the file handling method. 4. Which file opening mode should be used to open file only if the file exists? 5. T various classes available for file operations. 6. Define: i) seekg() ii) seekp() 7. 1. What is file? Explain various file stream classes needed for file manipulation. 2. Explain how to open file in C++ program? Describe the various file opening modes. 3. What is file? Describe various approach to detect end-of-file example. 4. Write C++ program to copy contents of two binary files into third file. 5. Accept file name as command line argument. If the file does not exist, display error message. If it exists, display its contents and calculate the length of the longest line in the file. Write a C++ program for above. 6. Write a program in C++ that will create a data file containing the list of telephone numbers and person name.use a class object to store each set of data in following format. Person-Name Telephone-Number ABC 2319554 XYZ 2512279 Theory Assignments-10 1. Sate two advantages of templates. 2. What is function template? 3. It is some times necessary to overload function template. Justify true/false. 4. Give the syntax to create an object of template class. 1. Using generic function, write a C++ program to swap two char or two float variables.