publisher school book co., (0824) 2496938, 4281777 sapna book house, (0824) 4232800 mysore sapna...

16

Upload: truongdiep

Post on 02-Apr-2018

228 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman
Page 2: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman
Page 3: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman

© Publisher

Oswaal Books

OUR DISTRIBUTORS ANDAMAN & NICOBARPORT BLAIR Mitali Enterprises, (03192) 230749 Kumar General Store, 9932082455 ANDHRA PRADESHGUNTOOR Y. Renuka Devi, (0863) 2252308HYDERABAD Himalaya Book World, (040) 24732057, 66822350 Sri Balaji Book Depot, (040) 27613300 UBS Publisher & Dist., 9951078309 Unique Book World, (040) 40061423VIJAYAWADA Sri Kanka Durga Book Stall, 09849144007 Akshaya Book Corner, 09666155555 Vijaysai Book Centre, (0866) 6627554VISHAKHAPATNAM JBD Educational, (0891) 6666062, 6636669 Sri Rajeshwari Book Link, (0891) 6661718 ASSAMBONGAIGAON Raju Pustak Sadan, (03664) 222403GUWAHATI Book Emporium, 9864057226 Manika Books, 8876881519 UBS Publisher, 9401154448 BIHARMUNGER New Aman Book & Stationers, (06344) 220757MUZAFFARPUR Pustak Bhandar, 9097046555PATNA Gyan Ganga, (0612) 2578394, 2263011 Nova Publisher & Distributors, (0612) 2666404 UBS Publisher, (0612) 267397, 2672856 Shri Durga Pustak Mandir, (0612) 2301704 Vikas Book Depot, (0612) 2304753 Sharda Pustak Bhandar, (0612) 2300600 Bokaro Student Friends, (0612) 2300600PURNEA Chaurasia Book Centre, 09006717044 CHATTISGARHDURG Bhagwati Bhawani Book Depot, (0788) 2327620RAIPUR Shri Ramdev Traders, (0771) 4099446, 9425213679 DELHIDELHI Mittal Books, (011) 23288887 Prozo (Global Educa Share Pvt. Ltd) 8587837835 R.D. Chawla & Sons, (011) 23282361, 9990093567 UBS Publisher, (011) 23273601 GOAGOA Golden Heart Emporium, (0832) 2725208, 3257383 GUJARATAHMEDABAD Abhyas Book, (079) 26766366 Bhagwati Centre, (079) 40065346, 9825007199 Hardik Book Agency, (079) 22148725 Patel Book Agency, (079) 25324741 Rohinee Sales, (079) 27503622 Tushar Book, (079) 26578741, 26587103 Uppal Brother, (079) 22860529BALLABH VIDYANAGAR Ajay Book Store, (02692) 238237GANDHIDHAM Arham Book Depot, (02836) 237833NAVSARI College Store, (02637) 258642VADODARA Maneesh Book Shop, (0265) 2363270VAPI Vinay General Store, 9925817463, 8758882123SURAT Kazi & Sons, (0261) 2767156, 9879328741 Saraswati Book House, (0261) 22095608, 8153022244 Shopping Point, (0261) 2230097, 9824108663 HARYANAGURGAON Adlakha Stationery, (0124) 2306991, 9136277733 JHARKHANDBOKARO Bokaro Student Friends, (06542) 234706DHANBAD Bokaro Student Friends, (0362) 2302493HAZARIBAGH Khandelwal Book Depot, (06546) 222287, 225325,

9708607489RANCHI Gyan Ganga Ltd., (0651) 2563570 Bokaro Student Friends, (0651) 2212447 KARNATAKABENGALURU Vasanta Book House, (080) 22216342 Maruti Book Centre, (080) 40124558 Prakash Sahitya (080) 22871030 Sri Sai Ram Book House, (080) 41472635 Sri Balaji Books & Stationers, (080) 22117659 Sapna Book House – (Gandhinagar, (080) 40114455), (Sadashivnagar, (080) 41236271), (Jayanagar, (080)

49066700), (Koramangala, (080) 40839999), (Residency Road, (080) 49166999), (Indiranagar, (080) 40455999), (Bannerghatta Road, (080) 42566299), (Nagavara, (080) 67294151), UBS Publisher & Dist., 9341621469, 22266681

BELLARY Chaitanya Agency and Books, 8277477778DAVANGERE Laxmi Agencies, (08192) 231271GULBARGA L.E. Bhavikatti, (08472) 261400HUBLI Renuka Book Depot, (0836) 4257624 Sapna Book House, (0836) 4249999MANGALORE School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800MYSORE Sapna Book House, (0821) 4004499SHIMOGA Diana Book Gallery, 09886185310 KERALACALICUT Aman Book Stall, (0495) 3048187, 2721282ERNAKULAM Asad Book House, (0484) 2370431 Academic Book House, (0484) 2376613 Surya Book House, (0484) 2363721JOMER NILAYAM H & C Store, (0484) 2350128 UBS Publisher & Dist., (0484) 2353901KANNUR Mustafa, (0497) 2769809KOTTAYAM H & C Store, (0481) 2304351 BOOK Centre, (0481) 2566992KOZHIKODE T.B.S. Publishers, (0495) 2721025, 2720085PALARIVATTOM H & C Store, (0484) 2344337THRISSUR Minerva Books, (0457) 2338301TRIVANDRUM Acedemic Book House, (0471) 2333349 H & C Store, (0471) 2572010, 9446411996

MADHYA PRADESHGWALIOR Krishna Sons, (0751) 2320431INDORE Arun Prakashan, (0731) 2454372, 2459448, 3244544 Akurti Publishing House, (0731) 2456024, 2456025 Student Book Depot, (0731) 2535892BHOPAL UBS Publisher & Dist., 97547535412JABALPUR Akash Book Distributor, (0761) 4063099 Vinay Pustak Sadan, (0761) 2411194KATNI Agrasen Stationers, (07622) 403377, 09229658467REWA Siddharth Enterprises, (07662) 404019Shahdol New Virat Pustak Bhandar, (07652) 244185 MAHARASHTRAAHMEDNAGAR Heera Stationers, (0241) 2418774AKOLA Harney Book Depot, 09922669647 Rathi Paper Traders, (0724) 2452679, 2452979AMRAVATI Delta Pen House, (0721) 2663672AURANGABAD Aarti Book Centre, (0240) 2663672 Maya Book Centre, (0240) 2360150BHUSAWAL Anil Book Depot, (02582) 225412CHANDRAPUR Novelty Book Depot, (07172) 277418JALGAON Sharma Book Depot, (0257) 6958794 Vidhyadhan Book House, (0257) 2225548KOLHAPUR Jai Book Co., (0231) 2651008MUMBAI Shivam Book & Stationers, (022) 28381014, 28236000 Reshma Agency, (022) 23070853 Vidyarthi Sales Agencies, (022) 43029999NAVI MUMBAI Krishna Book Store, (022) 27744962, 32980838 Ravechi Book Stationary, 022-27720445NAGPUR Triupati Books Store, 0712-24560864 Laxmi Pustakalya, (0712) 2720379 Novelty Book Depot, (0712) 2534884 Renuka Book Distributor, 9765406133 Shree Balaji Agency, (0712) 2452361 UBS Publisher & Dist., (0712) 6437909, 2736010 Vijay Book Depot, (0712) 2534217, 2520496NANDED India Book Agencies, 9890489460 Maheshwari General & Gift Centre, 9422870354 Vijay Book Centre, 9872994436PUNE New Venture Natraj Book Shop, (020) 24485054 Sai Shubham, (020) 69498635, 9975687687 UBS Publisher & Dist., 9860288838SANGLI G. R. Tamhankar Books, (0233) 2373605SOLAPUR Mahavir General Store, (0217) 2723405WARDHA Unique Traders, (07152) 243617, 9960644752YAVATMAL Dilip Book Agencies, (07232) 245450 ODISHABHUBANESWAR Pragenya Book Store, (0674) 2405757 Sagar Book Store, (0674) 2516040, 2506040 UBS Publishers & Dist., (0674) 2314446 PUNJABBARNALA Bhaian Di Hatti, (01679) 2321717 Nav Chetan Book, 09779050692BHATINDA Janta Book Depot, (0164) 2253993LUDHIANA Amit Book Depot, (0161) 2727038 Bhatia Book Centre, (0161) 2747713, 9815277131PATIALA Adarsh Pustak Bhandar, (0175) 2311430 RAJASTHANBHARATPUR Sunil Book Centre, (05644) 233777, 220650KOTA Raj Trader, 0744-24429090BHILWARA Nakoda Book Depot, (01482) 239653JAIPUR Goyal Book Distributors, (0141) 2571673 Saraswati Book House, (0141) 2610823SIKAR Student Book Company, (01572) 256094 TAMIL NADUCOIMBATORE CBSE Book Shop, (0422) 2393093 Majestic Book House, (0422) 2382333 Sapna Book House, (0422) 4629999 UBS Publisher & Dist., (0422) 2499914CHENNAI Arraba Book Traders, (044) 25387868 Indian Book House, (044) 24327784 Kalaimagal Store, (044) 45544072 Ravi Book House, (044) 24613174 Ruby Books, (044) 26425958 UBS Publisher & Dist., (044) 2374622PONDICHERRY Sri Laxmi Book Stall, 9443085499TRICHY Rasi Publication, (0431) 2703692 TRIPURAAGARTALA Balaji Book House, 9862208819 Book Corner, (0381) 2301945, 9856358594 UTTAR PRADESHAGRA Ajay Book, (0562) 2254621 Govind Book Shopee, (0562) 2526134 Manav Book Dist., (0562) 6545883, 9760021996 Om Pustak Mandir, (0562) 2464014, 3059218ALIGARH Shaligram & Sons, (0571) 2421887ALLAHABAD Mehrotra Book Depot, (0532) 2400129, 2266128AZAMGARH Sasta Sahitya Sadan, (05462) 224421BALIA Saraswati Shishu, (05498) 221042, 8317006473 Vidya Kendra, 9415281234LUCKNOW UBS Publication, (0522) 4025144MATHURA Vishnu Book Depot, (0565) 2401096NOIDA UBS Publisher & Dist., (0120) 4205516VARANASI Bokaro Student Friends, (0542) 2401250 WEST BENGALKOLKATA Chukervertty Chatterjee, (033) 22416425 Eureka Book Emporium, (033) 25934001 Katha–O–Kahani Pvt. Ltd., 22419071, 22196313 Krishna Book House, 8420431085 Oriental Publishers, (033) 22191591, 22198367 Saha Book House, (033) 22193671SILIGURI Agarwal Book House, (0353) 2535274 Novelty Books, (0353) 2525445

07

04

Page 4: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman

Syllabus� 5 � - 7 • Solved Paper (KVS), 2017 Agra region� 9 - 16

• Solved Paper (KVS), 2016 Agra region� ix �-� xvi

• Solved Paper (KVS), 2016 Guwahati region� xvii �-� xxiv

• Solved Paper (KVS), 2016 Mumbai region� xxv �-� xxxii

Unit 1 : Computer Fundamentals

� 1.� Computer Overview and its Basics� 1� -� 10

� 2.� Software Concepts� 11� -� 21

� 3.� Data Representation� 22� -� 26

� 4.� Microprocessor and Memory Concepts� 27� -� 33

Unit 2 : Programming Methodology

� 5.� Programming Methodology� 34� -� 39

� 6.� Algorithms and Flowcharts� 40� -� 46

Unit 3 : Introduction to C++

� 7.� Getting Started with C++� 47� -� 54

� 8.� Data Type, Variables and Constants� 55� -� 60

� 9.� Operators and Expression in C++� 61� -� 69

Unit 4 : Programming in C++

� 10.� Flow of Control� 70� -� 85

� 11.� Header Files and Library functions � 86� -� 93

� 12.� Introduction to user Defined Function� 94� -� 105

� 13.� Structured Data Type : Array� 106� -� 122

� 14.� User Defined Data Types : Structure� 123� -� 128

CONTENTS

( 3 )

Page 5: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman

PREFACE

CBSE always believes in Global Trends of Educational Transformation. The CBSE

curriculum gets its lead from National Curriculum Framework – 2005 and Right to Free and

Compulsory Education Act – 2009. The aim of CBSE Curriculum is not just to let learners

obtain basic knowledge but to make them life-long learners. CBSE always updates and

reviews the syllabus to make it more relevant with educational transformation and in last few

years the chapters and topics which CBSE has added are very interesting and increase

practical knowledge.

Oswaal Question Banks are designed to nurture individuality and thus enhance one's

innate potentials which helps in increasing the self-study mode for students. This book

strengthens knowledge and attitude related to subject. It is designed in such a way that students

can set their own goals and can improve their problem solving and thinking skills.

The journey of this book is never ending as this book is reviewed every year and

new questions, previous year's examination questions, new HOTS or any change in

syllabus is updated time to time. Also regular review and readers’ feedback increases the

efficiency of this book gradually.

Moreover every Question Bank strictly follows the latest syllabus and pattern, and

contains more than sufficient questions and brief description of chapters, which help students in

practicing and completing the syllabus. Questions incorporated in this Question Bank

encompass all the ‘Typologies’ mentioned by CBSE namely Remembering, Understanding,

Application, High Order Thinking Skills and Evaluation. Solutions for these have been checked

twice and efforts have been made to align them closely to the Marking Scheme. Practically, this

book provides students everything they need to learn and excel.

At last we would like to thank our authors, editors, reviewers and specially students who

regularly send us suggestions which helps in continuous improvement of this book and makes

this book stand in the category of “One of the Best”. Wish you all Happy Learning.

–Publisher

( 4 )

Page 6: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman

Total

Unit-1: Computer Fundamentals (18 Theory+6 Practical) Periods Classification of computers: Basics of computer and its operation; Functional Components and their interconnections, concept of Booting. Software concepts: Types of Software - System Software, Utility Software and Application Software System Software: Operating System, Compiler, Interpreter and Assembler; Operating System: Need for Operating System, Functions of Operating System (Processor Management, Memory Management, File Management and Device Management), Types of Operating System-Interactive (GUI based), Time Sharing, Real Time and Distributed, Commonly used Operating System: UNIX, LlNUX, Windows, Solaris, BOSS (Bharat Operating System Solutions); Mobile OS - Android, Symbian IOS. Utility Software: Anti Virus, File Management tools, Compression tools and Disk Management tools (Disk Cleanup, Disk Defragmenter, Backup). Open Source Concepts: Open Source Software, Freeware, Shareware, and Proprietary Software. Application Software: Office Tools - Word Processor, Presentation Tool, Spreadsheet Package, Database Management System; Domain Specific tools - School Management System, Inventory Management System, Payroll System, Financial Accounting, Hotel Management, Reservation System and Weather Forecasting System. Number System: Binary, Octal, Decimal, Hexadecimal and conversion between different number systems. Internal Storage encoding of Characters: ASCII, ISCII (Indian Scripts Standard Code for Information Interchange), and UNICODE (for multilingual computing) Microprocessor: Basic concepts, Clock speed (MHZ, GHz), 16 bit, 32 bit, 64 bit, 128 bit processors; Types - CISC Processors (Complex Instruction Set Computing), RISC Processors (Reduced Instruction Set Computing), and EPIC (Explicitly Parallel Instruction Computing). Memory Concepts: Units: Byte, Kilo Byte, Mega Byte, Giga Byte, Tera Byte, Peta Byte, Exa Byte, Zetta Byte, Yotta Byte. Primary Memory: Cache, RAM, ROM Secondary Memory: Fixed and Removable storage - Hard Disk Drive, CD/DVD Drive, Pen Drive, Blue Ray Disk.

Input Output Ports/Connections: Serial, Parallel and Universal Serial Bus, PS-2 port, Infrared

port, Bluetooth, Firewire.

Unit-2: Programming Methodology (28 Theory+10 Practical)Periods General Concepts: Modular Approach, Clarity and Simplicity of Expressions, Use of proper names for Identifiers, Comments, Indentation; Documentation and Program Maintenance; Running and Debugging programs, Syntax Errors, Run-Time Errors, Logical Errors Problem Solving Methodologies: Understanding of the problem, Solution for the problem, Identifying minimum number of inputs required for output, Writing code to optimizing execution time and memory storage, step by step solution for the problem, breaking down solution into simple steps (modular approach), Identification of arithmetic and logical operations required for solution; Control Structure- Conditional control and looping (finite and infinite).

Problem Solving: Introduction to Algorithms/Flowcharts.

Latest Syllabus for the Academic Year 2017-18Computer Science C++

( 5 )

Page 7: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman

Introduction to user-defined function and its requirements.

Defining a function; function prototype, Invoking/calling a function, passing arguments to function, specifying argument data types, default argument, constant argument, call by value, call by reference, returning values from a function, calling functions with arrays, scope rules of functions and variables local and global variables. Relating to Parameters and return type concepts in built-in functions.

Structured Data Type

Arrays: Introduction to Array and its advantages.

One Dimensional Array: Declaration/initialization of One-dimensional array, Inputting array elements, accessing array elements, manipulation of array elements (sum of elements, product of elements, average of elements, linear search, finding maximum/minimum value). Declaration / Initialization of a String, string manipulations (counting vowels/ consonants/ digits/ special characters, case conversion, reversing a string, reversing each word of a string)

Two-dimensional Array: Declaration/initialization of a two-dimensional array, inputting array elements, accessing array elements, manipulation of Array elements (sum of row element, column elements, diagonal elements, finding maximum / minimum values)

User-defined Data Types: Introduction to user defined data types.

Structure: Defining a Structure (Keyword Structure), declaring structure variables, accessing structure elements, passing structure to functions as value and reference, argument/parameter, function returning structure, array of structure, passing an array of structure as an argument/ a parameter to a function. Defining a symbol name using typedef keyword and defining a macro using #define preprocessor directive.

Unit-3: Introduction to C++ (44 Theory + 36 Practical) Periods Getting Started: C++ character set, C++ Tokens (Identifiers, Keywords, Constants, Operators,)Structure of a C++ Program (include files, main function), Header files – iostream.h, iomanip.h, cout, cin; use of I/O operators (<<and>>), Use of endl and setw ( ), Cascading of I/O operators, compilation , Error Messages; Use of editor, basic commands of editor, compilation, linking and execution. Data Types, Variables and Constants: Concept of Data types; Built-in Data types: char, int , float and double; Constants: Integer Constants, Character constants (- \n, \t, \b), Floating Point Constants, String Constants; Access modifier: const; Variables of built-in-data types, Declaration/Initialization of variables, Assignment statement, Type modifier: signed, unsigned, long Operator and Expressions: Operators: Arithmetic operators (-,+,*,/,%), Assignment operator (=), c++ shorthands (+=, -=,*=,/=,%=) Unary operators (-), Increment (++) and Decrement (--) Operators, Relation operator (>,>=,<=,=,!=), Logical operators (!,&&,||), Conditional operator: <condition>?<if false>; Precedence of Operators; Automatic type conversion in expressions, Type casting;

UNIT 4: PROGRAMMING IN C++ (50 Theory + 48 Practical) Periods Flow of control Conditional statements: if else, Nested if, switch..case..default, use of conditional operator,

Nested switch..case, break statement (to be used in switch..case only); Loops: while, do –while, for and Nested loops.

ctype.h

strrev (),

sqrt

( 6 )

Page 8: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman

( 7 )

Practical – C++

Duration: 3 hours Total Marks: 30

1. Programming in C++ 10

One programming problem in C++ to be developed and tested on Computer during the examination.

Marks are allotted on the basis of following:

Logic : 6 Marks

Documentation : 2 Marks

Output presentation : 2 Marks

2. Project Work 06 + 4 *

Problems using String, Number, array and structure manipulation

General Guidelines: Initial Requirement, developing an interface for user (it is advised to use text based

interface screen), developing logic for playing the game and developing logic for scoring points

l Memory game: A number guessing game with application of 2 dimensional arrays containing

randomly generated numbers in pairs hidden inside boxes.

l Hollywood/Hangman: A word Guessing game

l Cows 'N Bulls: A word/number Guessing game

l Random Number Guessing Game (High\Low)

l A game to check whether a word does not use any of the forbidden letters

l Cross ‘N’ knots game: A regular tic-tac –toe game.

or

Similar projects may be undertaken in other domains. (As mentioned in general guidelines for project, given

at the end of the curriculum in a group of 2-4 students)

* Collaboration and presentation of the project

3. Practical File 5+1*

(a) Record of the configuration of computer system used by the student in the computer lab (by

exploring inside computer system in the first 2 lab classes).

(b) Must have minimum 20 programs from the topics covered in class XI course.

l Programs on Control structures

l Programs on String manipulations

l Programs on array manipulations(1D & 2D)

l Programs on structures.

*1 mark is for innovating while developing programmes.

6. Viva Voce 04

Viva will be asked from the syllabus covered in class XI and the project developed by the student(s).

*1 mark is for innovating while developing programme.

Page 9: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman

Writing Notes

1. .............................................................................................................................................

2. .............................................................................................................................................

3. .............................................................................................................................................

4. .............................................................................................................................................

5. .............................................................................................................................................

6. .............................................................................................................................................

7. .............................................................................................................................................

8. .............................................................................................................................................

9. .............................................................................................................................................

10. .............................................................................................................................................

11. .............................................................................................................................................

12. .............................................................................................................................................

13. .............................................................................................................................................

14. .............................................................................................................................................

15. .............................................................................................................................................

16. .............................................................................................................................................

17. .............................................................................................................................................

18. .............................................................................................................................................

19. .............................................................................................................................................

20. .............................................................................................................................................

21. .............................................................................................................................................

22. .............................................................................................................................................

23. .............................................................................................................................................

24. .............................................................................................................................................

25. .............................................................................................................................................

( 8 )

Page 10: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman

KENDRIYA VIDYALAYA SANGATHAN[AGRA REGION]

SESSION ENDING EXAMINATION 2017

SUBJECT : COMPUTER SCIENCE C++CLASS–XI

(SOLVED PAPER)

Time : 3 Hours Max. Marks : 70

General Instructions : (i) All Questions are compulsory.

(ii) Programming Language : C++

Q. 1. (a) What is a process? 1 (b) What is one’s complement form of - 13 1 (c) What do you mean by language processor? 1 (d) Write a short note on System buses? How many types of buses are there? 2 (e) What is an operating system? What are its function? 2 (f) Evaluate (with verification) : 3 (i) (FACE)16 = (?)2 (ii) (1010001.11)2 = (?)16 (iii) (266)8 = (?)2Q. 2. (a) Write down the name of a Fourth Generation programming language? 1 (b) Write down the names of two traditional programming languages? 1 (c) Explain the transitive nature of inheritance? 1 (d) Give names of two programming Paradigms? 1 (e) What do you mean by Object Oriented Programming (OOP)? Write down various general concepts of

OOP? 2 (f) What are main error types? Which types are most dangerous and why? 2 (h) Write an algorithm to print the table of given number n. 2 (g) Differentiate between Compiler and Interpreter? 2Q. 3. (a) ‘‘C++ is a case sensitive programming language’’. Is this statement True or False? 1 (b) What is the range of an Integer? 1 (c) Write down name of four escape sequences. 1 (d) Write down the name of header files for following functions. 2 (a) Strlen ( ) (b) setw ( ) (c) clrscr ( ) (d) islower ( ) (e) Evaluate the following where a, b, c are integers and d, f are floating point numbers. 2 The value of a = 16, b = 4 and d = 4.5 (i) f = a*b + a/b (ii) c = d * a + b % a Q. 4. (a) What is type conversion? How many types of type conversion is allowed in C++. Explain with example. 2 (b) What is an expression? How an expression is different from statement? 2 (c) What are operators? Define various types of operators with suitable examples used in C++? 3 (d) Determine the number of elements and number of bytes required to store following arrays. 2 (i) float numbers [5] [15] (ii) char name [20] (e) Explain Break and Continue statement in C++ with example. 2Q. 5. (a) Write an alternative code for the following using switch case construct : 2 char choice; if (choice==A) cout<<“You have passed with First Division with Distinction”; else if (choice==B) cout<<“You have passed with First Division”;

Page 11: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman

10 ] OSWAAL CBSE Question Bank, Computer Science (C++)–XI

(b) What output will be the following code fragment produce? int i = 10, j = 10; if (a < 100) if (b > 50) ++ i ; else ++j ; cout<<‘‘i=’’<<i<<‘‘\n’’; cout <<‘‘j=’’<<j<<’’\n’’; If the input is shown below : (i) a =30, b = 30 (ii) a = 60, b = 70 (c) Determine the output (Assuming that required header files and main () is pre-written 2 fot (int i=20; i=100; i=10) { int j + 12 cout << j<< “,”; } (d) Find the error from the following code segment and rewrite the corrected code underlining the correction

inside. #include <iostream.h> main() { int x[5], y,z [5] for (i=0, i<5, i++ { x[i]=i; z=i+3; y=z; x=y; } } (e) Rewrite the following program after removing syntactical errors, underline each correction. 2 #include<iostream.h> main() { int sum [2, 4]; for(i=0;i<2;i++) for9j=0, j<=3, i++) { cout<<sum; }Q. 6. (a) Write a program to print the series for n terms 1, 2, 4, 8, 16, 32, ........ n. 3 (b) Write a program using nested loop to produce following design. 3 A AB ABC ABCD ABCDE (c) Write a C++ function to calculate the factorial of a number input using function. 3Q. 7. (a) What is a structure? Write a program to declare a structure Student and display input/output access of

structure number are given below. 3 Roll no. Name, Marks, Age (Choose appropriate data type by yourself) (b) Write a program to read a string and print how many words are stored in the string 3 (c) Write a program to declare two dimension array of 5 rows and 4 columns and find sum of elements row-wise

and column wise. 4

Page 12: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman

Solved Paper - 2017 [ 11

SOLUTIONS 1. (a) Performing arithmetic operations and logical operations on data to convert them in useful information is

called a process. 1 (b) 1’s complement of - 13 = 1’s complement of (11110010) = 00001101 1 (c) Language Processor — a translator system software that is used to translate the program written in high-

level language or assembly language into machine code is called ’Language processor’. 1 (d) System buses — A bus system consists of a set of electrical conducting lines, through which binary information

is transferred. In a common bus system, busses are classified into three types : (i) Data bus — A bus carries data or information to or from memory is called data bus. (ii) Address bus — It carries memory address. (iii) Control bus — It carries the control signals between the units of a computer. 2 (e) Operating System — It is a set of programs that executes the operations of computer hardware and software.

It behaves like a bridge between user and machine. Main functions of operating System : 1. Device Management 2. Processor Management 2 3. Memory Management 4. File Management (f) (i) (FACE)16 = (15 10 12 14)16 Þ (1111101011001110)2 as base 16 can be expressed as 24. Therefore every number with base 16 can be

expressed in 4-digit for base 2. (ii) (1010001.11)2 = 0101 0001 1100 ¯ ¯ ¯ 5 1 C = (51.C)16 (iii) (266)8 º 2 6 6 ¯ ¯ ¯ 010 110 110 3 = (010110110)2 2. (a) Structured Query Language (SQL). 1 (b) Name of two traditional programming Languages COBOL FORTRAN (c) Transitive nature of Inheritance 1 By transitive nature of inheritance means that if a child class inherited from a parent class is inherited further

then all the sub-child classes of child class will get the properties of the parent class too. 1 (d) Two programming paradigms : 1. Generic programming language / Procedural Programming 2. Dynamic Programming language/ Modular Programming 1 (e) Object Oriented Programming (OOP) OOP has been introduced with a view to overcome the drawbacks of conventional programming approaches.

The OOP approach is based on certain concepts that help in achieving its goal of overcoming the drawbacks of conventional programming approaches.

OOPs Concepts : 1. Data Abstraction 2. Data Encapsulation 3. Inheritance 4. Polynorphism 5. Modularity 2 (f) Error Types : The various types of errors in C++ is as follows : 1. Syntax errors 2. Semantic errors 3. Runtime error 4. Logical error 1 A compiler detects only syntax errors, semantic errors and type errors. Logical and runtime errors can be

detected only by tracing the program Line by Line. Syntax errors are more dangerous for any program because syntax refers to the set of rules that governs the

construction of valid statements in a language. 1

Page 13: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman

12 ] OSWAAL CBSE Question Bank, Computer Science (C++)–XI

(g) An algorithm to print the table of a given number n- 1. Start 2. Read number n 3. Ctr = 1 4. Multiple = n × ctr 5. Print count times n = multiple 6. Is ctr = 10 7. If ‘Yes’, terminate the program (End). 8. If ‘No’, add 1 to the current value of ctr. 9. Go to step 4. 2 (h) Difference between compiler and Interpreter : 1. Compiler scans the entire program and translates it as a whole into machine code whereas interpreter

translates program one statement at a time. 2. Compiler takes large amount of time to analyze the source code but the entire execution time is

comparatively faster whereas interpreter takes less amount of time to analyze the source code but the entire execution is slower..

3. Compiler generates the error message only after scanning the entire program. So, debugging is comparatively hard. Interpreter continues translating the program until the first error is met, in which case it stops. Hence debugging is easy.

4. Programming language like C, C++ use compilers and python, Ruby use interpreters. 3. (a) ‘‘C++ is a case sensitive programming language’’- Yes, C++ is a case sensitive programming language. A ‘#include’ and ‘#Include’ are not the same thing.

In fact, # Include does not exist at all. So, whether the user is creating its own function or using one from a library, check for case sensitivity. 1

(b) Range of an Integer : (i) Short int 2bytes (Bit width) –32768 to 32767 (Range) (ii) Long int 4bytes (Bit width) –2147483648 to 2147483647 1 (c) Escape Sequences : (i) \’ — Single quote (ii) \’’ — double quote (iii) \\ — backslash (iv) \b — backspace 1 (d) Name of header files : (i) Strlen( ) — < string.h> (ii) setw( ) — <iomanip.h> (iii) clrscr( ) — <conio.h> (iv) islower( ) — <ctype.h> (e) a = 16, b = 4, d = 4.5 (i) f = a * b + a / b = 16 * 4 + 16 / 4 = 16 * 4 + 4 = 64 + 4 = 68 (ii) c = d * a + b % a = 4.5 * 16 + 4 * 16 = 72.0 + 64 = 136.0 4. (a) Type conversion—Converting an expression of a given type into another is called ‘type casting’. There are

two types of conversion. (i) Implicit conversion—In this conversion, the value gets automatically converted to the specific type to

which it is signed. example, #include<iostream.h> using namespace Joy; void main ( ) { short x = 2000; int y; 1 y=x; } In this example, the data type short namely variable x is converted to int and is assigned to the integer

variable y. So, it is possible to convert short to int, int to float and so on. (ii) Explicit conversion—It can be done using type cast operator.

Page 14: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman

Solved Paper - 2017 [ 13

example, #include<iostream.h> using namespace Joy; void main( ) { int a, float b, c; cout<<‘‘a :’’; cin>>a; cout<<‘‘b:’’; 1 cin>>b; c=Float(a)+b; cout<<‘‘c is:’’<<c; } (b) Expression and Statements : An expression is created when one or more operators are combined. Every expression has a type and a result.

An expression becomes a statement when followed by a semicolon. for example, x = 0; is a statement and x = 0 is an expression. 2

Several expression can be separated using a comma ’, ’ ; they are then evaluated left to right. (c) Operators : An operator is a symbol which is used to perform certain mathematical or logical operations.

They are used in a program to manipulate data and variables. Types of operators (i) Arithmetic operators +, –, *, /, %,**, // for example, let a = 10 and b = 20 - a + b will give 30. - a – b will give –10. - a * b will give 200. 1 - b / a will give 2. - b % a will give 0. (ii) Relational operators : = = ; ! =, <>, <, >, > = , <= for example, let a = 10 and b = 20 - (a == b) is not true. - (a ! =) is true. - (a <> b) is true. 1 - (a > b) is not true. - (a < b) is true. (iii) Assignment operator : = , +=, ‘‘~, *– , /= (iv) Bitwise operator : &, 1, ^, ~, <<, >> (v) Logical operator : and, or, not (d)

Number of Elements Number of bytes

(i) Float Numbers [5] [15] : 5 × 15 = 75

(ii) Char name [20] : 20

5 × 15 × 2 = 150 bytes

20 × 1 = 20 bytes

(e) Break Statements : The break statement enables a program to skip over part of the code. A break statement terminates the

smallest enclosing while, do-while, for or switch statement. For example, for (i=0;i<10;i++) { j=0; cout<<‘‘\n enter character’’; cin>>char; cout<<‘‘\n’’; for (;;) { cout<<char; j++; if (j==10) break; } cout << ’’\n....’’; }

Page 15: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman

14 ] OSWAAL CBSE Question Bank, Computer Science (C++)–XI

Continue Statement- The continue statement is a jump statement like the break statement. In continue statement, instead of

forcing termination, it forces the next iteration of the loop to take place, skipping any code in between. example, int a, b, c, r for (i = 0; i<20; i++) { cout <<“/enter the numbers”; cin>>a>>b; if (b==0) {cout <<‘‘\n the denominator cannot be zero’’ <<enter again!’’; continue; } else c = a/b; cout << ‘‘\n Quotient’’; } 5. (a) cin>>choice; switch(choice) { case ‘A’ : you have passed with first Division with Distinction ; break ; case ‘B’ : You have passed with First Division ; } (b) (i) i = 10, j = 11 (ii) i = 11, j = 10 (c) Output : 10, 15, 20, 25, 30, 35, 40, 45, 50 (d) #include<iostream.h> main( ) { int x[5],y,z[5]; for(int i=0;i<5;i++) { x [i]=i; z[i]=i+3; y=z; x=y; } } (e) #include<iostream.h> main ( ) { int sum [2] [4]; for {int i=0; i<2;i++) { for (intj=0;j<=3;j++) { cout<<sum[i][j]; 2 } } } 6. (a) #include<iostream.h> #include<conio.h> void main( ) { clrscr( ); int i; for(i=1; i<=n;i*=2) cout<<i<<‘‘ ’’; getch( ); } 3

Page 16: Publisher School Book Co., (0824) 2496938, 4281777 Sapna Book House, (0824) 4232800 MYSORE Sapna Book House, (0821) 4004499 SHIMOGA Diana Book Gallery, 09886185310 KERALA CALICUT Aman

Oswaal CBSE Chapterwise/TopicwiseQuestion Bank For Class 11 Computer

Science C++ (Mar. 2018 Exams)

Publisher : Oswaal Books ISBN : 9789386339744 Author : Panel Of Experts

Type the URL : http://www.kopykitab.com/product/11253

Get this eBook

25%OFF