vinodsrivastava.com Consider the following c++ code and answer the questions from (i) to (iv): class Personal protected: public:

Similar documents
Q2 Based on Class Concept and features Total Marks 10. Q2(A) Theory Based on Class Concept Marks :2

KENDRIYA VIDYALAYA TIRUMALAGIRI,SECUNDERABAD UNIT TEST II

Computer Science 2006 (Delhi)

Computer Science, Class XII ( ) (Autumn Break-2015) (Holiday H.W) Chapter No.4 to 6, 11 to 13

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

(d) Observe the following C++ code very carefully and rewrite it after removing any/all syntactical errors: [2] Include < iostream.

91/1 COMPUTER SCIENCE. Series SHC/1. dksm ua- jksy ua- Code No. Roll No. Candidates must write the Code on the title page of the answer-book.

BHARATIYA VIDYA BHAVAN S V.M.PUBLIC SCHOOL, VADODARA. Class : XII SAMPLE PAPER Max Marks : 70

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

HOLIDAYS HOMEWORK CLASS : XII. Subject : Computer Science

Guru Harkrishan Public School, Karol Bagh Pre Mock Class XII Sub: COMPUTER SCIENCE Allowed :3 hrs

CBSE 12th Computer Science Question Papers

Model Sample Paper 2015

Downloaded from

COMPUTER SCIENCE Time allowed : 3hours] [Maximum Marks :70

vinodsrivastava.com Constructor and Destructor

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 7 Data Modeling with Entity Relationship Diagrams

Session Chapter 4: Classess & Object

INHERITANCE. PART I Choose the correct answers

L42. j; das BMNCH { charcity[20]; . public : BRANCHO; void Haveit( ) ;

KENDRIYA VIDYALAYA IIT CAMPUS CHENNAI 36 COMPUTER SCIENCE. Half Yearly

Code No. 91. (i) All questions are compuls9ry. 1. (a) What is the difference between Type Casting and Automatic Type

CBSE Sample Paper 2015 Computer Science C++ Class XII Time 3hrs M.M 70

91/1 COMPUTER SCIENCE. Series SHC/1. dksm ua- jksy ua- Code No. Roll No. Candidates must write the Code on the title page of the answer-book.

COMMON PRE-BOARD EXAMINATION COMPUTER SCIENCE


Guru Gobind Singh Public School Sector: V/B, Bokaro Steel City Assignment (Level 2)

Babaria Institute of Technology Computer Science and Engineering Department Practical List of Object Oriented Programming with C

HOLIDAY HOMEWORK ASSIGNMENT-5 Q1. What will be the output of the following program segment Class Num { int x; float y; public: void init( ) { x = y =

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

STUDENT std_id fname lname address gender grade class_president school_id. STAFF sid fname lname bdate gender Salary role school_id

Programming Fundamentals (CS-302 )

Developed By Strawberry

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

Series SHC COMPUTER SCIENCE. Code No. 91. Roll No.

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

COMPUTER SCIENCE SAM PLE PAPER 2-HALF YEARLY EXAMINATION

(i) case (ii) _delete (iii) WHILE (iv) 21stName

Developed By Strawberry

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

KENDRIYA VIDYALAYA SANGATHAN (KOLKATA REGION) Second Pre Board Examination ( ) COMPUTER SCIENCE (Theory) Class-XII Marking Scheme

Class XII Computer Science (083) Sample Question Paper Time allowed: 3 Hours Max. Marks: 70

COMPUTER SCIENCE (083)

COMPUTER SCIENCE. Time allowed : 3 hours Maximum Marks : 70. General Instructions: All questions are compulsory. Programming Language: C++

ANNA UNIVERSITY: CHENNAI M.E./M.Tech. DEGREE PRACTICAL EXAMINATIONS MAY/JUN CS9228 WEB TECHNOLOGY LAB

THE INDIAN COMMUNITY SCHOOL, KUWAIT

Base class or Super class. Subclass or Derived class

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

Inheritance: Single level inheritance:

SAMPLE QUESTION PAPER CLASS-XII, SESSION: SUBJECT: COMPUTER SCIENCE

Computer 2 App1. App3 API Library. App3. API Library. Local Clipboard

1st Midterm Exam: Solution COEN 243: Programming Methodology I

Introduction to Programming Using Java (98-388)

First time registration: Go to and click on the "Register" button located in the blue log in box to the right of the homepage.

KENDRIYA VIDYALAYA NO.1 SAGAR XII-COMPUTER SCIENCE ( ) HOMEWORK SUMMER VACATION

Sample Paper COMPUTER SCIENCE (Theory) Class-XII Time Allowed: 3hours Maximum Marks: 70

PRINCE PUBLIC SCHOOL PRE-BOARD EXAMINATION ( ) SAMPLE PAPER-1 COMPUTER SCIENCE XII TIME ALLOWED: 3 HOURS

COMPUTER SCIENCE. Time allowed : 3 hours Maximum Marks : 70

KENDRIYA VIDYALAYA SANGATHAN BHUBANESWAR REGION SECOND PREBOARD EXAMINATION FOR CLASS XII SUBJECT: COMPUTER SCIENCE

JAVA MOCK TEST JAVA MOCK TEST II

Arrays Classes & Methods, Inheritance

Systems and Principles Unit Syllabus

Developed By Strawberry

KE DRIYA VIDYALAYA SA GATHA CHE AI REGIO COMMO PREBOARD EXAMI ATIO COMPUTER SCIE CE. CLASS- XII Time Allowed: 3 hours Max.

AISSCE COMMON MODEL EXAMINATION Subject Computer Science [083] Time Allotted: 3 Hours Maximum Marks: 70

CS2300: File Structures and Introduction to Database Systems

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

Example: Structure, Union. Syntax. of Structure: struct book { char title[100]; char author[50] ]; float price; }; void main( )

Chapter-8 DATA TYPES. Introduction. Variable:

Introduction to Computer Science II (CSI 1101)

Systems and Principles Unit Syllabus

Chapter 2: Basic Elements of Java

CSCI 2212: Intermediate Programming / C Review, Chapters 10 and 11

CS 246: Software Abstraction and Specification. Lecture 8. Object Composition

Show me the Full Instructions. Show me the Quicksheet Instructions CLICK HERE CLICK HERE. Registering for CITI Human Subjects Research Training

SAMPLE PAPER. Class: XII SUBJECT COMPUTER SCIENCE. Time: 3 Hours MM: 70

Python Class Definition. Java Class Definition. Python Class Use public class Student { Java Class Use. Python Class Definition 10/6/2016

Computer Programming

Chapter 10. Class & Objects in JAVA. By: Deepak Bhinde PGT Com.Sc.

KendriyaVidyalayaSangathan Kolkata Region

Instructions. Quiz #2. Name: Solutions Student Number: Signature:

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

Computational Expression

Computer Programming

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

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

INFORMATICS PRACTICES

Thanks for your cooperation! The Questionnaire of the Developers' Experiment 1

Programming Fundamentals II (C++ II) Final Exam June 17 th, Sun, 2007

Chapter-14 STRUCTURES

ME 172. Lecture 2. Data Types and Modifier 3/7/2011. variables scanf() printf() Basic data types are. Modifiers. char int float double

INDEX. A SIMPLE JAVA PROGRAM Class Declaration The Main Line. The Line Contains Three Keywords The Output Line

2016 COMPUTER SCIENCE

Single Dimension Arrays

COMPUTER APPLICATIONS

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

Answer ALL Questions. Each Question carries ONE Mark.

2. E/R Design Considerations

1.00 Lecture 13. Inheritance

Object-Oriented Programming. Chapter 4

Transcription:

vinodsrivastava.com Consider the following c++ code and answer the questions from (i) to (iv): class Personal int Class,Rno; char Section; char Name[20]; personal(); void pentry(); void Pdisplay(); class Marks: private Personal float M[5]; char Grade[5]; Marks(); void Mentry(); void Mdisplay(); class Result: public Marks float Total, Agg; char FinalGrade, comments[20]; Result(); void Rcalculate(); void Rdisplay(); (i) Which type of inheritance is shown in the above example? (ii) Write the names of those data members, which can be directly accessed from the objects of class Result. (iii) Write the names of those member functions which can be directly accessed from the objects of class Result. (iv) Write names of those data members, which can be directly accessed from the Mentry() function of class Marks.

1) Answer the questions (i) to (iv) based on the following: class ORGANIZATION char Address[20]; double Budget, Income; void Compute(); ORGANIZATION(); void Get(); class WORKAREA : public ORGANIZATION char Address[20]; int Staff; double Pay; void Calculate() WORKAREA(); void Display(); class SHOWROOM : private ORGANIZATION char Address[20]; float Area; double Sale; SHOWROOM(); (i) Name the type of inheritance illustrated in the above C++ code. (ii) Write the names of data members, which are accessible from member functions of class SHOWROOM. (iii) Write the names of all the member functions, which are accessible from objects belonging to (iv) class WORKAREA. Write the names of all the members, which are accessible from objects of class SHOWROOM. 3) Answer the questions (i) to (iv) based on the following: class Student int Rno; char Name[20]; float Marks; void Result(); Student(); void Register(); void Display(); C++ 12 @ VKS-Learning Hub Page 2

class Faculty long FCode; char FName[20]; float Pay; Faculty(); class Cource : public Student, private Faculty long CCode[10]; char CourceName[50]; char StartDate[8], EndDate[8]; Cource(); void Commence(); void CDetail(); (i) Which type of inheritance is illustrated in the above C++ code? (ii) Write the name of all the data members, which is/are accessible from member function Commence of class Course. (iii) Write the names of member functions, which are accessible from objects of class Cource. (iv) Write the names of all the members, which are accessible from objects of class Faculty. 4) Answer the questions (i) to (iv) based on the following: class Chairperson long CID; // Chairperson Identification Number char CName[20]; char Description[40]; void Allocate(); Chairperson(); void Assign(); class Director int DID; // Director ID char DName[20]; char Profile[30]; Director(); void Input(); void Output(); class Company : private Chairperson, public Director int COID; // Company Identification Number char City[20], Country[20]; C++ 12 @ VKS-Learning Hub Page 3

(i) (ii) (iii) (iv) Company(); void Display(); Which type of inheritance out of the following is specifically is illustrated in the above C++ code? (a) Single Level Inheritance (b) Multi Level Inheritance (c) Multiple Inheritance Write the name of data members, which are accessible by objects of class type Company? Write the names of all member functions, which are accessible by objects of class type Company. Write the names of all members, which are accessible from member functions of class Director. 5) Answer the questions (i) and (iv) based on the following code: class FaceToFace char CenterCode[10]; void Input(); void Output(); class Online char website[50]; void SiteIn(); void SiteOut(); class Training : public FaceToFace, private Online long Tcode; float charge; int period; void Register(); (i) Which type of inheritance is shown in the above example? (ii) Write the name of all the member functions accessible from Show() function of class Training. (iii) Write the names of all members accessible through object of class Training. (iv) Is the function Output() accessible inside the function SiteOut()? Justify your answer. 6) Answer the questions (i) and (iv) based on the following code: class Dolls char DCode[5]; float Price; void CalcPrice(float); Dolls(); void DInput(); void DShow(); C++ 12 @ VKS-Learning Hub Page 4

class SoftDolls : public Dolls char SDName[20]; float Weight; SoftDolls(); void SDInput(); void SDShow(); class ElectronicDolls : public Dolls char EDName[20]; char BatteryType[10]; int Batteries; ElectronicDolls(); void EDInput(); void EDShow(); (i) Which type of inheritance is shown in the above example? (ii) How many bytes will be required by an object of the class ElectronicDolls? (iii) Write the names of all data members accessible from member functions of the class SoftDolls. (iv) Write name of all the member functions accessible by an object of the class ElectronicDolls. 7) Answer the questions (i) and (iv) based on the following code: class Trainer char Tno[5], Tname[20],Specialisation[10]; int Days; float Remuneration; void AssignRem(float); Trainer(); void TEntry(); void TDisplay(); class Learner char Regno[10], Lname[20], Program[10]; int Attendence,Grade; Learner (); void LEntry(); void LDisplay(); class Institute : public Learner, public Trainer char Icode[10], Iname[20]; Institute(); void IEntry(); void IDisplay(); C++ 12 @ VKS-Learning Hub Page 5

(i) (ii) (iii) (iv) Which type of inheritance is depicted by the above example? Identity the member functions that cannot be called directly from the object of class Institute from the following: TEntry() LDisplay() IEntry() Write the names of all members accessible from member functions of the class Institute. IF class Institute was derived privately from class Learner and privately from class Trainer then name the member functions that could be accessed through objects of class Institute. 8) Answer the questions (i) and (iv) based on the following code: class Stationary char Type; char Manufacturer[10]; Stationary(); void Read_sta_details(); void Disp_sta_details(); class Office : public Stationary int no_of_types; float cost_of_sta; void Read_off_details(); void Disp_off_details(); class Printer : private Office int no_of_users; char delivery_date[10]; void Read_pri_details(); void Disp_pri_details(); void main() Printer MyPrinter; } (i) Mention the member names which are accessible by MyPrinter declared in main() function. (ii) (iii) What is the size of MyPrinter in bytes? Mention the names of functions accessible from the member function Read_pri_details () of class Printer. C++ 12 @ VKS-Learning Hub Page 6