Session Chapter 4: Classess & Object

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

Constructor & Classes Questions

Class and object Holiday Homework

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

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

KENDRIYA VIDYALAYA NO.02 AFS HINDAN G.BAD Holiday Homework Class XII Computer Science

CLASS XII GUESS PAPER COMPUTER SCENCE (083)

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

ASSIGNMENT CLASS : XII ( ) COMPUTER SCIENCE

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat

Computer Science 330 Assignment

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

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

Darshan Institute of Engineering & Technology for Diploma Studies

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

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

Object Oriented Pragramming (22316)

Computer Science 2006 (Delhi)

CLASSES AND OBJECT CHAPTER 04 CLASS XII

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

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

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

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

COMPUTER SCIENCE (083)

KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION FIRST COMMON PRE BOARD EXAMINATION CLASS:XII - (COMPUTER SCIENCE )

Holidays HomeWork

C# MOCK TEST C# MOCK TEST II

Computer Science 2006 (Outside Delhi)

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


void Add() { cin >> trainnumber; gets(trainname); } void display() { cout<<trainnumber <<":"<<TrainName<<end;

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

KENDRIYA VIDYALAYA TIRUMALAGIRI,SECUNDERABAD UNIT TEST II

HOLIDAYS HOMEWORK CLASS : XII. Subject : Computer Science

Object Oriented Programming(OOP).

Honors Introduction to C (COP 3223H) Program 5 Pizza Shack Inventory and Finances

INHERITANCE: EXTENDING CLASSES

COMPUTER SCIENCE (083)

END TERM EXAMINATION

15 Create a Java GUI application which has the following interface as shown below:

SECTION A [Only for candidates, who opted for 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 =

Programming Fundamentals (CS-302 )

PHPBasket 4 Administrator Documentation

CS304 Object Oriented Programming Final Term

KendriyaVidyalayaSangathan Kolkata Region

Hong Kong University of Science and Technology COMP151: Object Oriented Programming

Assignment 1 due Monday at 11:59pm

GRADE CENTER. Smart Views. Create Smart Views. You can create five types of smart views in the Grade Center:

Announcements. Lecture 05a Header Classes. Midterm Format. Midterm Questions. More Midterm Stuff 9/19/17. Memory Management Strategy #0 (Review)

THE INDIAN COMMUNITY SCHOOL, KUWAIT

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

About this exam review

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

Arrays in C. Rab Nawaz Jadoon DCS. Assistant Professor. Department of Computer Science. COMSATS IIT, Abbottabad Pakistan

Snapshots/User Manual for last two year students (Session & ) who had taken admission directly through DDE Online Panel

Lab 12 Object Oriented Programming Dr. John Abraham

Object-Oriented Programming Concepts

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

CLASS XII SECOND TERM EXAMINATION SUBJECT : COMPUTER SCIENCE SET A2 (SOLUTIONS)

Objects and State. COMP1400 Week 9. Wednesday, 19 September 12

Programming II (CS300)

Chapter 2 (Dynamic variable (i.e. pointer), Static variable)

VALLIAMMAI ENGINEERING COLLEGE

Blackboard Learn: Basics

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

Objects and Classes. 1 Creating Classes and Objects. CSCI-UA 101 Objects and Classes

Information on My Account

CLASS XII SECOND TERM EXAMINATION SUBJECT : COMPUTER SCIENCE SET A1(SOLUTIONS)

DELHI PUBLIC SCHOOL BOKARO STEEL CITY ASSIGNMENT FOR THE SESSION

9/9/2017. If ( condition ) { statements ; ;

KENDRIYA VIDYALAYA SANGATHAN TINSUKIA REGION PRE BOARD EXAMINATION SUBJECT COMPUTER SCIENCE

Rani Durgavati Vishwavidyalaya Jabalpur (M.P.) (UICSA) Master of Computer Application (MCA) Practical List of. MCA III SEM Session -2010

Code No: R Set No. 1

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

Q2. What will be displayed in jtextfield1 and jtextfield2 after the following code is executed:

COMPUTER APPLICATIONS

Reports in MSB. Form or Screen: MSB - Reports Updated: 2/5/18 QRG Doc. #: Q.SA.014

6.096 Introduction to C++

DELHI PUBLIC SCHOOL BOKARO STEEL CITY

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK

INFORMATICS PRACTICES. Practical file. Session

Introduction to C++ 2. A Simple C++ Program. A C++ program consists of: a set of data & function definitions, and the main function (or driver)

MAY 29 and MAY 30. What s New? When is it Happening? Here are the new features most relevent to CRC users:

Informatics Practices - Assignments. A Practical Workbook

Furniture Wizard Security Introduction

vinodsrivastava.com Constructor and Destructor

IT 1033: Fundamentals of Programming Data types & variables

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

KENDRIYA VIDYALAYA SANGATHAN DEHRADUN REGION 1 st Pre-Board Examination, Class XII Computer Science(083) Time: 3 Hours Max.

INFORMATION TECHNOLOGY NOTES

Answer Key with Marking Scheme

CP I LAB MANUAL. Expt No 2 To Check Whether A Year Is A Leap Year Using if-else-if.

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

HOW TO REGISTER FOR THE TEAS ASSESSMENT AT A PSI SITE

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

Introduction to Programming EC-105. Lecture 2

ENCAPSULATION. private, public, scope and visibility rules. packages and package level access.

Efuels Training Manual. Contents

DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING PROGRAMMING TECHNIQUES I EE271

Transcription:

Session 2017-18 Chapter 4: Classess & Object How does a class enforce data-hiding, abstraction, and encapsulation? What is the significance of access specifiers in a class? How are class and object different in terms of Object Oriented Programming Differentiate between public and private visibility modes in context of Object Oriented Programming using a suitable example illustrating each. What are the advantages and disadvantages of inline functions? What do you understand about a member function? How does a member function differ from an ordinary function? What is the relationship of a class and its objects? How is memory allocated to a class and its objects? What do you mean by static data member of a class? Explain the characteristics of a static data member. Define a class Candidate in C++ with the following description : (Delhi 2011) Private Members Public Members A data member RNo (Registration Number) of type long A data member Name of type string A data member Score of type float A data member Remarks of type string A member function AssignRem( ) to assign Remarks as per the Score obtained by a candidate. Score range and the respective Remarks are shown as follows Score Remarks >= 50 Selected A function ENTER( ) to allow user to enter values for RNo, Name, Score and call function AssignRem( ) to assign the remarks. A function DISPLAY( ) to allow user to view the content of all the data members.

Write a C + + program using classes and objects to simulate result preparation system for 20 students. The data available for each student includes rollno, name and marks in 3- subjects. The percentage marks and grade are to be calculated from the above information. The percentage marks are the average marks and the grade is calculated as follows percentage marks < 50 grade 'E' >=50 & <60 'D' >=60& <75 'C' >=75 & <90 'B' >=90& <100 'A' Define a class RESORT in C++ with the following description : Rno Name Charges Days COMPUTE( ) //Data member to store Room No //Data member to store customer name //Data member to store per day charges //Data member to store number of days of stay //A function to calculate and return Amount as Days*Charges and if the value of Days*Charges is more than 11000 then as 1.02*Days*Charges Public Members : Getinfo( ) Dispinfo( ) Define a class STOCK in C++ with the following description : Private Members : ICode of type integer (Item Code) Item of type string (Item Name) //A function to enter the content Rno, Name, Charges and Days //A function to display Rno, Name, Charges, Days and Amount (Amount to be displayed by calling function COMPUTE( )) Price of type float (Price of each item) Qty of type integer (Quantity in stock)

Discount of type float (Discount percentage on the item) A member function FindDisc( ) to calculate discount as per the following rule Public_Members : If Qty<=50 Discount is 0 If 50<Qty<=100 Discount is 5 IfQty>100 Discount is 10 A function Buy( ) to allow user to enter values for ICode, Item, Price, Qty and call function FindDisc( ) to calculate the Discount. A function ShowAll( ) to allow user to view the content of all the data members. What is wrong with the following code? 1 #include <iostream.h> 2 class Complex 3 { 4 doubler ; 5 double i ; 6 public: 7 void print (const char *p = 0, Complex& c) ; 8 }; 9 void print(const char *p, Complex& c) 10 { 11 if(!p) return ; 12 tout << p << c.r<< c.i; 13 } 14 int main( ) 15 { complex a ; a.print( ) ; 16 17 return 0 ;

18 } 1. Define a class Flight in C++ with the following specification : Private Members : E A Data Member FlightNumber of type integer A Data Member Destination of type String E A Data Member Distance of float type E A Data Member Fuel of type float A Member Function CalFuel( ) to calculate the value of fuel as per the following criteria : Distance Fuel <= 1000 500 more than 1000 and <= 2000 1100 more than 2000 2200 Public Members : A function Feed_Info( ) to allow user to enter values for FlightNumber, Destination. Distance & Call Function CalFuel( ) to calculate the quantity of fuel. A Function Show_Fuel( ) to allow user to view the content of all the data members. 2. Define a class in C++ with the following description : r A data member TrainNumber of type integer. A data member Destination of type string A data member Distance of type float A data member Fuel of type float A member.function CALFUEL( ) to calculate the value of Fuel as per the following criteria :

. Define a class TESTMATCH in C++ with the following description : Private Members : o TestCode of type integer o Description of type string o NoOfCandidates of type integer o CenterReqd (number of centers required) of type integer A member function CALCULATECNTR( ) to calculate and return the number of centers as (NoOfCandidates /100 + 1) Public Members : o A function GETDATA( ) to allow user to enter values for TestCode, Description, NoOfCandidates & call function CALCULATECNTR( ) to calculate the number of centers. A function PUTDATA( ) to allow user to view the content of all the data members in the following format : TEST MATCH INFORMATION Test Match Code Description Total Candidates Centers Required Define a class named ADMISSION in C++ with the following descriptions : Private Members : AD_NO integer (Range 10-2000) NAME Array of characters (String) CLASS character FEES float Public Members : Function Read_Data( ) to read an object of ADMISSION type Function Display( ) to display the details of an object Function Draw_Nos() to choose 2 students randomly and display the

details. Use random function to generate admission nos to match with AD_NO.