Answer Key with Marking Scheme

Similar documents
Introduction to Programming Using Java (98-388)

C++ Important Questions with Answers

Chapter 3 Function Overloading

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

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

Object Oriented Pragramming (22316)

Downloaded from

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

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

Object-Oriented Programming (OOP) Fundamental Principles of OOP

Short Notes of CS201

Data Structures using OOP C++ Lecture 3

CS201 - Introduction to Programming Glossary By

Polymorphism. Zimmer CSCI 330

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

OBJECT ORIENTED PROGRAMMING. Ms. Ajeta Nandal C.R.Polytechnic,Rohtak

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

Tokens, Expressions and Control Structures

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

HOLIDAYS HOMEWORK CLASS : XII. Subject : Computer Science

XII- COMPUTER SCIENCE VOL-II MODEL TEST I

COIMBATORE EDUCATIONAL DISTRICT

An Object Oriented Programming with C

cout << "How many numbers would you like to type? "; cin >> memsize; p = new int[memsize];

Object Oriented Programming. Solved MCQs - Part 2

SRE VIDYASAAGAR HIGHER SECONDARY SCHOOL. TWO MARKS


SECTION A [Only for candidates, who opted for C++]

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

OOP THROUGH C++(R16) int *x; float *f; char *c;

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

Fast Introduction to Object Oriented Programming and C++

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

Object Oriented Programming

22316 Course Title : Object Oriented Programming using C++ Max. Marks : 70 Time: 3 Hrs.

OOPs Concepts. 1. Data Hiding 2. Encapsulation 3. Abstraction 4. Is-A Relationship 5. Method Signature 6. Polymorphism 7. Constructors 8.

Interview Questions of C++

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

CS3157: Advanced Programming. Outline

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

Introduction to C++ Systems Programming

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat

OBJECTS. An object is an entity around us, perceivable through our senses. Types of Object: Objects that operate independently.

cast.c /* Program illustrates the use of a cast to coerce a function argument to be of the correct form. */

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

Sri Vidya College of Engineering & Technology

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

Recap. ANSI C Reserved Words C++ Multimedia Programming Lecture 2. Erwin M. Bakker Joachim Rijsdam

C++ (Non for C Programmer) (BT307) 40 Hours

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.

1 Shyam sir JAVA Notes

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

INDIAN SCHOOL MUSCAT FIRST TERM EXAMINATION

COMPUTER SCIENCE 1998 (Delhi Board)

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

Classes. Logical method to organise data and functions in a same structure. Also known as abstract data type (ADT).

C++ Programming: Polymorphism

SRE VIDYASAAGAR HIGHER SECONDARY SCHOOL

Sample Paper 2013 SUB: COMPUTER SCIENCE GRADE XII TIME: 3 Hrs Marks: 70

Programming. C++ Basics

CAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE

VIRTUAL FUNCTIONS Chapter 10

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

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

Come and join us at WebLyceum

The University of Alabama in Huntsville Electrical and Computer Engineering CPE Example of Objective Test Questions for Test 4

C++ Quick Guide. Advertisements

Module 1. C++ Classes Exercises

COMP322 - Introduction to C++

Introduction to C++ Introduction. Structure of a C++ Program. Structure of a C++ Program. C++ widely-used general-purpose programming language

Computer Science XII Important Concepts for CBSE Examination Questions

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

Cpt S 122 Data Structures. Course Review Midterm Exam # 2

Introduction to C++ with content from

Split up Syllabus (Session )

KLiC C++ Programming. (KLiC Certificate in C++ Programming)

Come and join us at WebLyceum

STRUCTURING OF PROGRAM

About this exam review

Problem Solving with C++

Course "Data Processing" Name: Master-1: Nuclear Energy Session /2018 Examen - Part A Page 1

Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and

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

Object oriented programming with C++

MAHALAKSHMI ENGINEERING COLLEGE B TIRUCHIRAPALLI

ADTs & Classes. An introduction

Padasalai.Net s Model Question Paper

8. Functions (II) Control Structures: Arguments passed by value and by reference int x=5, y=3, z; z = addition ( x, y );

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING OBJECT ORIENTED PROGRAMMING CLASS : THIRD SEMESTER CSE

C++ Inheritance and Encapsulation

Computer Programming

OBJECT-ORIENTED PROGRAMMING CONCEPTS-CLASSES II

Numerical Computing in C and C++ Jamie Griffin. Semester A 2017 Lecture 2

Lesson Plan. Subject: OBJECT ORIENTED PROGRAMMING USING C++ :15 weeks (From January, 2018 to April,2018)

Independent Representation

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix

AN OVERVIEW OF C++ 1

AIR FORCE SCHOOL,BAMRAULI COMPUTER SCIENCE (083) CLASS XI Split up Syllabus (Session ) Contents

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

Transcription:

INDIAN SCHOOL MUSCAT HALF YEARLY EXAMINATION- 017 Subject: COMPUTER SCIENCE (Code 08) CLASS- XII Max. Marks: 70 Date: 0-09-017 Time: Hours Answer Key with Marking Scheme General Instructions: Answer all questions Programming language is C++ 1.a 1 Mark for theory and 1 Mark for example. Automatic type conversion is the process of converting one data type to another in an arithmetic expression automatically by the compiler without the programmers intervention. Type casting is the conversion of one data type to another in an arithmetic expression forcefully by the programmer. eg: float x = 5. ; int y = 6; int z = x + y ; // here x value is converted to int float v = x + float (y) ; // here y in this expression is 6.0 b. ½ Mark each (i) exit() - process.h (ii) setprecision() - iomanip.h c. ½ Mark each for each correction #include <iostream.h> struct Memory { char drive ; float Size ; int Partitions ; D1; void main() { D1.drive = 'C' cout<< \n Enter drive name : ; cin>> D1.drive ; cout<< \n Enter drive size and number of partitions : ; cin>>d1.size>>d1.partitions; d. If all values of the output are correct give marks. If partial values are correct give 1 mark (working should be shown). output 5040 904040 4040 1 Page 1 of 6

e. If all values of the output are correct give marks. If partial values are correct give 1 mark(working should be shown). output ALefo@*ps f. 1 ½ marks each for possible given outputs (i) 67XXAX (iii) 66AAXA g. If all values of the output are correct give marks. If partial values are almost correct give marks(working should be shown). output AHM@N@OIS@.a 1 Mark each Abstraction refers to the act of representing essential features without including the background details or explanations. Data hiding is the act to hiding the data from a direct access by an object from outside. Inheritance is the capability of one class of things to derive capabilities or properties from another class. Polymorphism is the ability for a message or data to be processed in more than one form. The wrapping up of data and operations/functions (that operate on the data) into a single unit(called class) is known as Encapsulation..a ½ Mark each for each point(any four) 1.Search for exact match is performed. If an exact match is found, the function is invoked..if exact match is not found, match through integral promotion is searched for..if first two types fails then a match through application in C++ standard conversion rule is searched for. 4.If all the above mentioned steps fails, a match through application of userdefined conversions and built-in conversion. 5. If all the above steps fails, compiler flashes a message reporting no match. b. ½ Mark each a) callme(4, 66) ; // calls function 1 b) callme(5., 44);// Ambiguity between function1 and function 4 c) callme( a, 56); // function d) callme(f, 44F);// Ambiguity between function1 and function 4 e) callme(88) ; // Ambiguity between function 5 and function 6 f) callme(85.4) ; // calls function Page of 6

4.a 1 mark each for class function definitions: class MARKER {private: char Product_code[ 6 ] ; char Brand_name[ 15 ] ; float Price; char Product_type[ 5 ]; char Category[ 0 ]; void Assign( ) { if(price>=0000) strcpy(category, Luxury ) else if(price>=10000) strcpy(category, Elegant ) else strcpy(category, Economy ) ; public: MARKER( ) { strcpy( Product_code, ST00 ) ; strcpy(brand_name, SONY ); strcpy(product_type, LCD ); strcpy(category, Economy ); Price = 10000 ; void Getdata( ) { cout << Enter Product code : gets(product_code) ; cout << Enter Brand name : gets(brand_name) ; cout << Enter Product Type : gets(product_type) ; cout << Enter Price : cin>> Price ; Assign( ); void Display( ) { cout << \nproduct code : <<Product_code ; cout << \nbrand name : << Brand_name ; cout << \nproduct Type : <<Product_type ; cout << \nprice : << Price ; cout << \ncategory : <<Category; ; b. 1 mark each for class functions definitions : class HANDSET { char Make[ 0 ] ; char Model[ 0 ] ; long int Price ; char Rating ; 4 4 Page of 6

public : HANDSET( char M[ ], char Mod[ ], long int P, char R) { strcpy(make, M) ; strcpy(model,mod) ; Price = P ; Rating = R ; long int RetPrice( ) { return(price) ; void Read_data( ) { cout << Enter the Make : gets(make) ; cout << Enter the model : gets(model) ; cout << Enter Price : cin>> Price ; cout << Enter Rating : cin>> Rating ; void Display( ) { cout << \nmake : << Make ; cout << \nmodel : << Model ; cout << \nprice : <<Price ; cout << \nrating : << Rating ; ; c. 1½ Marks for explanation and ½ mark for example public members of a class can be accessed by the object of that class directly from outside the class. private members of a class cannot be accessed directly by the object of that class from outside the class, only member functions of that class can access it directly. protected member of a class cannot be accessed directly by the object of that class from outside the class but they can be inherited to a derived class. eg: class Employee { private : int emono ; char name[ 5] ; protected : float salary,hra, DA, PF ; public: float total_salalry ; void getdata( ) ; void display( ) ; ; Page 4 of 6

d. 1 Mark each A static data member of a class is like global variable for its class. There is only one copy of this data member maintained for the class which is shared by all objects of that class. It is visible only within the class, however its lifetime is the entire program. A static data member should be declared with the keyword static in front of it. It has to be defined outside the class. e. 1 Mark each for each line of the output Output 5 : 1 : 0 1 : 1 : 50 5 : : 50 5.a ½ Mark each 1. Constructors are invoked automatically when the objects are created.. No return type can be specified for a constructor(not even void).. Constructors annot be inherited. 4. A constructor may no be static. i. Polymorphism, implemented using constructor overloading. ii. Book B; // to invoke function 1 Book W(B) ; // to invoke function iii. Function 4 is invoked automatically when the object gets out of scope. 6.a 1 Mark each In hierarchical inheritance many classes can be derived from one base class. In multiple inheritance a class can be derived form many base classes. i) Base class University Derived class - Department ii) name,hod, no_of_students,principal,vc. iii) 85 Bytes 7.a 1 Mark each File.seekp((-1) *sizeof(e), ios::cur) ;// Statement 1 File.write((char *)&E, sizeof(e)) ; // Statement b. ½ mark for proper function header. 1 and ½ marks for the logic and correct output c. ½ mark for proper function header. ½ marks for the correct logic. d. ½ mark for proper function header. ½ marks for the correct logic. Page 5 of 6

8.a ½ mark for proper function header. 1 and ½ marks for the logic and correct output b. ½ mark for proper function header. ½ marks for the correct logic. 9.a Freeware is a computer software which is made available free of charges and not necessarily free to be used, copied, studied, modified and redistributed. A switch is a device that is used to segment networks into different subnetworks called subnets or LAN segments.a switch is responsible for filtering. A bridge is a network device that establishes an intelligent connection between two local networks with the same standard but with different types of cable. c. 1 Mark each The crackers are malicious programmers who break into secure syatem. Hackers are more interested in gaining knowledge about computer systems and possibly using this knowledge for playful pranks. 1 Page 6 of 6