INTERNATIONAL INDIAN SCHOOL, RIYADH. Ch 1 C++ Revision tour

Similar documents
Constructor & Classes Questions

Downloaded from

(a) Differentiate between a call by value and call by reference method.

CHAPTER 9 INHERITANCE. 9.1 Introduction

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

Home Assignment for Class XII(Summer Vacation) Subject: CS Based on Library Functions ( 1 Mark)

Sample Paper 2012 Class XII Subject Computer Science

I Mid Semester May 2012 : Class XII : Computer Science Max Mark 50 : Time 2 Hrs. 1. a) What is macro in C++? Give example 2

List of Practical for Class XII Computer Science

Introduction to Programming Using Java (98-388)

Chapter-6 Classes and Objects. stud.execute(); getch();} Output:

QUESTION BANK SUB: COMPUTER SCIENCE(083)

KENDRIYA VIDYALAYA SANGATHAN TINSUKIA REGION PRE BOARD EXAMINATION SUBJECT COMPUTER SCIENCE

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

Q2) Define a class candidate in C++ with following Description: Private Members 4 Number) of type long

Computer Science 330 Assignment

void main() { int global=7 ; func( ::global,global) ; cout<<global<<, <<::global<< \n ; func(global,::global) ; cout<<global<<, <<::global<< \n ; }

KENDRIYA VIDYALAYA NO-1 ARMAPUR

BRAIN INTERNATIONAL SCHOOL. Computer Science Assignment CLASS XII OCTOBER 2018 Chapter-7. Data File Handling in C++ Text Files

Padasalai.Net s Model Question Paper

Downloaded S. from Kiran, PGT (CS) KV, Malleswaram STRUCTURES. Downloaded from

Short Notes of CS201

COMPUTER SCIENCE(083) SAMPLE QUESTION PAPER CLASS XII

COMPUTER SCIENCE (CODE 083) CLASS XII Time allowed : 3Hours Maximum. Marks 70

CS201 - Introduction to Programming Glossary By

Padasalai.Net Half Yearly Exam Model Question Paper

Object Oriented Programming. Solved MCQs - Part 2

A506 / C201 Computer Programming II Placement Exam Sample Questions. For each of the following, choose the most appropriate answer (2pts each).

HOLIDAYS HOMEWORK CLASS : XII. Subject : Computer Science

Autumn Break 2017 Exam Oriented Assignment Class-XII B, Computer Science

KUWAIT SAHODAYA EXAMINATION FIRST TERM SUBJECT : COMPUTER SCIENCE (083) : CLASS - XII SET - 3 Time : 3 Hours

Mock Test Paper-2. CBSE XII : Computer Science. Duration : 3hrs Max Marks : 70

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

CS201- Introduction to Programming Current Quizzes

CMSC 202 Section 010x Spring Justin Martineau, Tuesday 11:30am

(1)Given a binary file PHONE.DAT, containing records of the following structure type class Phonlist { char Name[20]; char Address[30]; char

Paytm Programming Sample paper: 1) A copy constructor is called. a. when an object is returned by value

1. FIBONACCI SERIES. Write a C++ program to generate the Fibonacci for n terms. To write a C++ program to generate the Fibonacci for n terms.

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

CHAPTER 1 Introduction to Computers and Programming CHAPTER 2 Introduction to C++ ( Hexadecimal 0xF4 and Octal literals 031) cout Object

Absolute C++ Walter Savitch

An Object Oriented Programming with C

SRI SARASWATHI MATRIC HR SEC SCHOOL PANAPAKKAM +2 IMPORTANT 2 MARK AND 5 MARK QUESTIONS COMPUTER SCIENCE VOLUME I 2 MARKS

CHRIST THE KING BOYS MATRIC HR. SEC. SCHOOL, KUMBAKONAM

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

Computer Science (330)

+2 Volume II OBJECT TECHNOLOGY OBJECTIVE QUESTIONS R.Sreenivasan SanThome HSS, Chennai-4. Chapter -1

JB Academy, Faizabad Half Yearly Examination Subject: Computer Science (083) Class XII

C++ 8. Constructors and Destructors

FORM 2 (Please put your name and form # on the scantron!!!!)

INDIAN SCHOOL MUSCAT FIRST TERM EXAMINATION

C++ Programming: Polymorphism

Downloaded from

Object-Oriented Programming (OOP) Fundamental Principles of OOP

KE DRIYA VIDYALAYA SA GATHA,CHE AI REGIO. COMMO PRE-BOARD EXAMI ATIO COMPUTER SCIE CE CLASS- XII Time allowed : 3 hours Maximum Marks : 70

m) sin() n) endl o) getch() p) cout

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

XII- COMPUTER SCIENCE VOL-II MODEL TEST I

PART I. Part II Answer to all the questions 1. What is meant by a token? Name the token available in C++.

Object Oriented Programming with c++ Question Bank

Session Chapter 4: Classess & Object

PROGRAMMING IN C++ COURSE CONTENT

JAVA GUI PROGRAMMING REVISION TOUR III

vinodsrivastava.com Constructor and Destructor


Object Oriented Pragramming (22316)

KENDRIYA VIDYALAYA TIRUMALAGIRI,SECUNDERABAD UNIT TEST II

CS105 C++ Lecture 7. More on Classes, Inheritance

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

Intro to OOP Visibility/protection levels and constructors Friend, convert constructor, destructor Operator overloading a<=b a.

Object Oriented Programming. Assistant Lecture Omar Al Khayat 2 nd Year

COIMBATORE EDUCATIONAL DISTRICT

STRUCTURING OF PROGRAM

COMPUTER SCIENCE (083)

CMPT 117: Tutorial 1. Craig Thompson. 12 January 2009

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p.

END TERM EXAMINATION

C++ Important Questions with Answers

COMS W3101 Programming Language: C++ (Fall 2016) Ramana Isukapalli

JB ACADEMY HALF-YEARLY EXAMINATION 2016 CLASS XII COMPUTER SCIENCE. Time: 3:00 Hrs. M.M.: 70


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

Time: 3 HOURS Maximum Marks: 100

I BSc(IT) [ Batch] Semester II Core: Object Oriented Programming With C plus plus - 212A Multiple Choice Questions.

COMPUTER APPLICATIONS

BEng (Hons) Telecommunications. Examinations for 2016 / Semester 2

VALLIAMMAI ENGINEERING COLLEGE

- HALF YEARLY EXAM ANSWER KEY DEC-2016 COMPUTER SCIENCE ENGLISH MEDIUM

COMPUTER SCIENCE XII Page 1

POLYMORPHISM 2 PART Abstract Classes Static and Dynamic Casting Common Programming Errors

POLYMORPHISM 2 PART. Shared Interface. Discussions. Abstract Base Classes. Abstract Base Classes and Pure Virtual Methods EXAMPLE

EXAM Microsoft MTA Software Development Fundamentals. Buy Full Product.

Answer Key with Marking Scheme

JAVA MOCK TEST JAVA MOCK TEST II

Tokens, Expressions and Control Structures

KENDRIYA VIDYALAYA ALIGANJ SHIFT-II HOLIDAY HOME WORK XII COMPUTER SCIENCE ARRAY AND STRUCTURES

Government Polytechnic, Muzaffarpur. Name of the Lab: OBJECT ORIENTED PROGRAMMING


CS304 Object Oriented Programming Final Term

Transcription:

Grade- XII Computer Science Worksheet Ch 1 C++ Revision tour 1) Explain in brief the purpose of function prototype with the help of a suitable example. 2) What is the benefit of using default parameter/argument in a function? Give a suitable example to illustrate it using C++ code. 3) What is the need of defining a MACRO? Explain with suitable example. 4) What is recursion? Explain with an example. 5) What is a function declaration? How is a function different from function definition? Differentiate between 6) Global variable and Local variable with example. 7) Run time error and Syntax error with example. 8) Logical error and Syntax error with example. 9) #define and const with example. 10) Type casting and automatic type conversion with example. 11) Call by value and call by reference with respect to memory allocation with example 12) Actual parameter and formal parameter with example. 13) Identifiers and Keywords 14) x and x in C++ 15) Break and continue statements. 16) Entry control loop and exit control loop. 17) While and do while loop 18) getche() and getch() 19) cout and puts() 20) Arrays and Structures 21) Structures and Classes 22) Character constants and string literals in terms of size. 23) Procedural programming and OOP

Grade- XII Computer Science Worksheet Ch 2 Object Oriented Programming Ch 3 Function Overloading 1. What is polymorphism? Give an example in C++ to show its implementation in C++. 2. What is Inheritance? Give an example in C++ to show its implementation in C++. 3. What is the difference between Object Oriented Programming and Procedural Programming? 4. Reusability of classes is one of the major properties f OOP. How is it implemented in C++. 5. Define the following terms: Inheritance and Encapsulation 6. Illustrate the concept of function overloading with the help of an example. 7. What is Function Overloading? 8. With the multiple definitions of single function name, what makes them significantly different?

Grade- XII Computer Science Worksheet Ch 4 Classes & Objects 1) Define a class employee with the following specifications: 4 Private members of class employee : empno integer ename 20 characters basic,hra,da float netpay float calculate( ) A function to calculate basic + hra + da with float return type Public member functions of class employee : havedata( ) function to accept values for empno, sname, basic, hra,da and invoke calculate( ) to calculate netpay dispdata( )function to display all the data members on the screen. 2) Define a class TEST in C++ with following description: 4 Private Members TestCode of type integer Description of type string NoCandidate of type integer CenterReqd (number of centers required) of type integer A member function CALCNTR() to calculate and return the number of centers As (NoCandidates/100+1) Public Members A function SCHEDULE() to allow user to enter values for TestCode, Description, NoCandidate & call function CALCNTR() to calculate the number of Centres A function DISPTEST() to allow user to view the content of all the data Members 3) Define a Class department with the following specifications :- private data members protype string (50 char) // product name list_price long Discount float dis_type char calculate() The 20% discount on every product it sells. At the time of festival season the discount will be 10% after 20% regular discount. If discount type is 'F' means festival and 'N' means nonfestival. The calculate() will calculate the discount net price and net price on the basics of following data Product name list price(rs) printer 12000 laptop 41000 TV 35000 speaker 6000 Public members:- constructor to initialize the string element with "NULL", numeric element with 0 character elements with 'N' Allow() :- ask to enter the product name,list price and discount type and function will invoked calculate to calculate the net price and discount price. show():- to generate the bill to the customer with all the details including net price and discount price.

Grade- XII Computer Science Worksheet Ch 5 Constructors & Destructors 1) Answer the questions after going through the following class. class Exam char Subject[20] ; int Marks ; public : Exam() // Function 1 strcpy(subject, Computer ) ; Marks = 0 ;} Exam(char P[ ]) // Function 2 strcpy(subject, P) ; Marks=0 ; } Exam(int M) // Function 3 strcpy(subject, Computer ) ; Marks = M ; } Exam(char P[ ], int M) // Function 4 strcpy(subject, P) ; Marks = M ;} a) Which feature of the Object Oriented Programming is demonstrated using Function 1, Function2, Function 3 and Function 4 in the above class Exam? b) Write statements in C++ that would execute Function 3 and Function 4 of class Exam. 2) Answer the questions after going through the following class. class Travel int days; Travel ( ) // Function 1 Days = 50; cout << Journey starts now << endl; } void sightseeing( ) // Function 2 cout << Sightseeing in the journey starts << endl;}

Travel (int Duration) // Function 3 Days = Duration; cout << Journey starts now << endl; } ~ Travel ( ) // Function 4 cout << Happy journey << endl; } i. In Object Oriented Programming, what is Function 4 referred to as and when does it get invoked/called? ii. In Object Oriented Programming, which concept is illustrated by Function 1 and Function 3 together? Write an example illustrating the calls for these functions. iii. What type of constructors are Function 1 and Function 3? iv. How is Function 4 different from Function 3? 4) Define a class Sports in C++ with following descriptions: Private members: S_Code of type long S_Name of type character array (String) Fees of type integer Duration of type integer Public members: Constructor to assign initial values of S_Code as 1001, S_Name as Cricket, Fees as 500, Duration 70 A function NewSports() which allows user to enter S_Code, S_Name and Duration. Also assign the values to Fees as per the following conditions: S_Name Fees Table 2000 Tennis Swimming 4000 Football 3000 A function DisplaySports() to display all the details.

Grade- XII Computer Science Worksheet Ch 6 Inheritance 1) class vehicle int wheels; protected: int passenger; void inputdata( int, int); void outputdata(); class heavyvehicle: protected vehicle int dieselpetrol; protected: int load; void readdata( int, int); void writedata(); class bus:private heavyvehicle char marks[20]; void fetchdata(char); void displaydata(); (i) (ii) (iii) (iv) Name the class and derived class of the class heavyvehicle. Name the data members that can be accessed from function displaydata() Name the data members that can be accessed by an object of bus class Is the member function outputdata() accessible to the objects of heavyvehicle class.

2) class book char title[20]; char author[20]; int noof pages; void read(); void show(); class textbook: private textbook int noofchapters, noof assignments; protected: int standard; void readtextbook(); void showtextbook(); class physicsbook: public textbook char topic[20]; void readphysicsbook(); void showphysicsbook(); (i) (ii) (iii) (iv) Name the members, which can be accessed from the member functions of class physicsbook. Name the members, which can be accessed by an object of Class textbook. Name the members, which can be accessed by an object of Class physicsbook. What will be the size of an object (in bytes) of class physicsbook.

Grade- XII Computer Science Worksheet Ch 7 Data File Handling 1. Write a function in a C++ to count the number of uppercase alphabets present in a text file BOOK.txt 2. Write a function in a C++ to count the number of alphabets present in a text file BOOK.txt 3. Write a function in a C++ to count the number of digits present in a text file BOOK.txt 4. Write a function in a C++ to count the number of white spaces present in a text file BOOK.txt 5. Write a function in a C++ to count the number of vowels present in a text file BOOK.txt 6. Write a function in a C++ to count the average word size in a text file BOOK.txt 7. Write a function in C++ to print the count of the word the as an independent word in a text file STORY.TXT. For example, if the content of the file STORY.TXT is There was a monkey in the zoo. The monkey was very naughty. Then the output of the program should be 2. 8. Assume a text file Test.txt is already created. Using this file, write a function to create three files LOWER.TXT which contains all the lowercase vowels and UPPER.TXT which contains all the uppercase vowels and DIGIT.TXT which contains all digits. 9. Create a function FileLowerShow() in c++ which take file name(text files)as a argument and display its all data into lower case 10. Write a function in C++ to count the number of lines present in a text file Story.txt. 11. Write a function in C++ to search for a BookNo from a binary file BOOK.DAT, assuming the binary file is containing the objects of the following class. class BOOK int Bno; char Title[20]; int RBno()return Bno;} void Enter()cin>>Bno;gets(Title);} void Display()cout<<Bno<<Title<<endl;} 12. Write a function in C++ to add new objects at the bottom of a binary file STUDENT.DAT, assuming the binary file is containing the objects of the following class. class STUD int Rno; char Name[20]; void Enter() cin>>rno;gets(name); } void Display()cout<<Rno<<Name<<endl;}