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

Similar documents
Constructor & Classes Questions

case control statement (switch case)

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

KENDRIYA VIDYALAYA PICKET : SECUNDERABAD :09 CLASS XII HOLIDAY HOME WORK

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 =

Session Chapter 4: Classess & Object

Class and object Holiday Homework

CBSE Sample Paper for Computer Science Class XII.

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

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

Guru Gobind Singh Public School Sector : V/B, Bokaro Steel City

KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION FIRST COMMON PRE BOARD EXAMINATION

ASSIGNMENT CLASS : XII ( ) COMPUTER SCIENCE

COMPUTER SCIENCE

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

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

KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION COMPUTER SCIENCE (083)

Sample Paper 2015 Class XII Subject Computer Science

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

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 : 3hours] [Maximum Marks :70

Character Literal i.e char x= a, single character enclosed in single quotes. String Literal i.e cout<< Welcome, anything enclosed in double quotes

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

HOLIDAYS HOMEWORK CLASS : XII. Subject : Computer Science

LSD DAV PUBLIC SCHOOL, PILKHUWA

UNIT 1 : PROGRAMMING IN C++

BRAIN INTERNATIONAL SCHOOL Term-II Class-XI Sub:- Computer Science Revision Sheet

COMPUTER SCIENCE SAM PLE PAPER 2-HALF YEARLY EXAMINATION

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.

#include<iostream.h> #include<conio.h> #include<ctype.h>

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

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

COMPUTER SCIENCE XII Page 1

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

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

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

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

KENDRIYA VIDYALAYA STUDY MATERIAL PATNA REGION COMPUTER SCIENCE

K.V. NO 1 ARMAPUR Computer Science- XII Summer Vacation Home Assignment

SAMPLE PAPER 2015 SUB - COMPUTER SCIENCE - (Theory) CLASS XII Time allowed: 3 hours Maximum marks: 70

CBSE GUESS PAPER. Roll No. Computer Sc. XII(083)/

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

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

(4) Find the syntax error(s), if any, in the following program: #include main() int x[5],*y,z[5]; for(i=0;i<5;i++) x[i]=i; z[i]=i+3; y=z; x=y; (5) Rew

Computer Science, Class XII ( ) (Summer Vacation-2015) (Holiday H.W) Chapter No.1 to 3

AUTUMN BREAK HOLIDAY HOMEWORK

THE EMIRATES NATIONAL SCHOOL SHARJAH THIRD MODEL EXAMINATION 2015 COMPUTER SCIENCE ( Code : 083) CLASS : XII MAX MARKS: 70

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

CLASS XII GUESS PAPER COMPUTER SCENCE (083)

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

DELHI PUBLIC SCHOOL BOKARO STEEL CITY

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

vinodsrivastava.com Constructor and Destructor

(d) Rewrite the following program after removing all the syntax error(s), if any. [2] include <iostream.h> void main ( )

KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION FIRST COMMON PRE BOARD EXAMINATION MARKING SCHEME. Code No. 083

KENDRIYA VIDYALAYA NO-1 ARMAPUR

COMPUTER SCIENCE (083)

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

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

1. a) Find the correct identifiers out of the following, which can be 2 used for naming Variable, Constants or Functions in a C++ program:

Computer Science XII Important Concepts for CBSE Examination Questions

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

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

COMPUTER SCIENCE (083)

INDIAN SCHOOL MUSCAT FIRST TERM EXAMINATION

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

KendriyaVidyalayaSangathan Kolkata Region

b) #include<iostream.h> void main() { int a, b; cout<<"input two integer values? "; cin>>a>>b; double avg=(a+b)/2.0; cout<<"average="<<avg<<endl; }

KENDRIYA VIDYALAYA SANGATHAN TINSUKIA REGION PRE BOARD EXAMINATION SUBJECT COMPUTER SCIENCE

KENDRIYA VIDYALAYA TIRUMALAGIRI,SECUNDERABAD UNIT TEST II

DELHI PUBLIC SCHOOL TAPI

THE INDIAN COMMUNITY SCHOOL, KUWAIT

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

KENDRIYA VIDYALAYA SANGATHAN MODEL QUESTION PAPER-5 BLUE PRINT CLASSS XII COMPUTER SCIENCE (083) TIME: 03:00 Hrs. MAX. MARKS: 70 S.No.

COMPUTER SCIENCE(083) SAMPLE QUESTION PAPER CLASS XII

KENDRIYA VIDYALAYA SANGATHAN, COMPUTER SCIENCE (THEORY) I PRE-BOARD TIME 3 HRS CLASS XII M. Marks 70

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

KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION FIRST PRE-BOARD EXAMINATION COMPUTER SCIENCE

INDIAN SCHOOL DARSAIT DEPARTMENT OF ICT

Sample Paper 2012 Class XII Subject Computer Science

BRAIN INTERNATIONAL SCHOOL. Term-I Class XI Sub: Computer Science Revision Worksheet

COMPUTER SCIENCE (Theory) - Class XII Marking Scheme

CPT101- Principles of Programming

Model Sample Paper 2015

Downloaded from

DELHI PUBLIC SCHOOL BOKARO STEEL CITY ASSIGNMENT FOR THE SESSION

Programming Fundamentals (CS-302 )


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

KENDRIYA VIDAYALAYA PANGODE MONTHLY TEST AUGUST 2015

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

COMPUTER APPLICATIONS

KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION. REVISION Examination 2013 COMPUTER SCIENCE (083) CLASS XII

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

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

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

I SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK a) What is the difference between Hardware and Software? Give one example for each.

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

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

Transcription:

KVITBP DEHRADUN SUMMER BREAK HOMEWORK, XII COMP SC, LEVEL A Q1) Define a class TEST in C++ with following description: 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) A function SCHEDULE() to allow user to enter values for TestCode, Description, NoCandidate & call function CALCNTR() to calculate the number ofcentres A function DISPTEST() to allow user to view the content of all the data members Q2) Define a class candidate in C++ with following Description: Private Members 4 Number) of type long respective Remarks are shown as follows: Score Remarks >=50 Selected less than 50 Not selected Public members remarks. er to view the content of all the data members Q3) Define a class ITEM in C++ with the following description : Private Members of type integer (Quantity of item in stock) If Qty <= 50 Offer is 0 If 50 < Qty <= 100 Offer is 5 If Qty >100 Offer is 10 Price, Qty and call function GetOffer( ) to calculate the offer. Q4) Define a class RESORT in C++ with following description: Private Members: Rno // Data member to store Room No4 www.cppforschool.com Name // Data member to store customer name Charges // Data member to store per day charges Days // Data member to store number of days of stay COMPUTE( ) // 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 : Getinfo( ) // A function to enter the content Rno, Name, Charges and Days Dispinfo( ) // A function to display Rno, Name, Charges, Days and Amount (Amount to be displayed by calling function COMPUTE( ) )

Q5) Define a class Tour in C++ with the description given below : Private Members : TCode of type string NoofAdults of type integer NoofKids of type integer Kilometres of type integer TotalFare of type float : A constructor to assign initial values as follows : TCode with the word NULL NoofAdults as 0 NoofKids as 0 Kilometres as 0 TotalFare as 0 A function AssignFare ( ) which calculates and assigns the value ofthe data member TotalFare as follows For each Adult Fare(Rs) For Kilometres 500 >=1000 300 <1000 &>=500 200 <500 For each Kid the above Fare will be 50% of the Fare mentioned above. Q6) Define a class TEST in C++ with following description: 4Private 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) 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 Q7) Define a class in C++ with following description: 4 Private Members data member Fuel of type float Distance Fuel <=1000 500 more than 1000 and <=2000 1100 more than 2000 2200 w user to enter values for Flight Number, Destination, Distance & call function CALFUEL() to calculate the quantity of Fuel Q8) Define a class ELECTION in C++ with the following descriptions: Write a suitable main ( ) function also to declare 3 objects of ELECTION type and find the winner and display the details. Data : candidate_name, party, vote_received Public members : Functions: Enterdetails ( ) To input data Display ( ) To display the details of the winner Winner ( ) To return the details of the winner trough the object after comparing the votes received by three candidates.

Q9) Define a class ITEM in C++ with following description: 4 Private Members Code of type integer (Item Code) Iname of type string (Item Name) Price of type float (Price of each item) Qty of type integer (Quantity of item in stock) Offer of type float (Offer percentage on the item) A member function GetOffer() to calculate Offer percentage as per thefollowing rule: If Qty<=50 Offer is 0 If 50<Qty100 Offer is 10 A function GetStock() to allow user to enter values for Code, Iname,Price, Qty and call function GetOffer() to calculate the offer A function ShowItem() to allow user to view the content of all the datamembers Q10) Define a class Student with the following specifications : public members : the percentage of marks. LEVEL B Q11) : Define a class HOTEL in C++ with the following description: Priva No Tariff and NOD and Amount (Amount to be displayed by calling function CALC( ) he value of NOD*Tariff Number) of type long ) to find the Grade as per the Aggregate Marks obtained by a student. Equivalent Aggregate marks range and the respective Grades are shown as follows Aggregate Marks Grade > = 80 A Less than 80 and > = 65 B Less than 65 and > = 50 C Less than 50 D24 Q13) Define a class employee with the following specifications : 4 Private members of class employee s. invoke calculate() to calculate netpay. + da with float return type LEVEL C Q14) Declare a class myfolder with the following specification : Private members of the class

an array of strings of size[10][25]( to represent all the names of files inside myfolder) long ( to represent total number of bytes available in myfolder) long ( to represent total number of bytes used in myfolder) public members of the class A function to accept values of Filenames, Availspace and Usedspace fromuser A Fucntion that returns the value of total Kilobytes available ( 1 Kilobytes = 1024 bytes) a function that displays the names of all the files in myfolder Q15) Define a class report with the following specification : marks obtained Q16) Define a class TAXPAYER in C++ with following description : name, marks, and invoke the function getavg(). definition. a. Name of type string b. PanNo of type string c. Taxabincm (Taxable income) of type float d. TotTax of type double e. A function CompTax( ) to calculate tax according to the following slab: Taxable Income Tax% Up to 160000 0 >160000 and <=300000 5 >300000 and <=500000 10 >500000 15 Public members : o o o A parameterized constructor to initialize all the members A function INTAX( ) to enter data for the tax payer and call function CompTax( ) to assign TotTax. A function OUTAX( ) to allow user to view the content of all the data members. LEVEL A 1. Observe the following program and find out, which output(s) out id (i) to (iv) will not be expected from program? What will be the minimum and maximum value assigned to the variables Chance? CBSE 2012 #include<stdlib.h> randomize(); int Arr[] = 9,6;, N; int Chance = random(2)+10; for(int c=0;c<2;c++) N= random(2); cout<<arr[n]; OUTPUT- i) 9#6# ii) 19#17# iii) 19#16# iv) 20#16# 2. Find the output of the following program: CBSE 2012 class METRO int Mno, TripNo, PassengerCount; public: METRO(int Tmno=1) Mno =Tmno; PassengerCount=0;

void Trip(int PC=20) TripNo++, PassengerCount+=PC; void StatusShow() cout<<mno<< : <<TripNo<< : <<PassengerCount<<endl; ; METRO M(5), T; M.Trip(); M.StatusShow(); T.StatusShow(); M.StatusShow(); 3. Rewrite the following program after removing the syntactical error(s) if any. Underline each correction. F = 10, S = 20; test(f;s); test(s); void test(int x, int y = 20) x=x+y; count<<x>>y; 4. Rewrite the following program after removing syntactical error(s) if any. Underline each correction. #include iostream.h Class MEMBER int Mno; float Fees; PUBLIC: void Register ( ) cin>>mno>>fees; void Display( ) cout<<mno<<" : "<<Fees<<endl; ; MEMBER delete; Register(); delete.display(); 5. Find the output for the following program: #include<ctype.h> void Encript ( char T[ ]) for( int i=0 ; T[i]!= \0 ; i += 2) if( T[i] = = A T[i] = = E ) T[i] = # ; else if (islower (T[i] )) T[i] = toupper(t[i]); else T[i] = @ ; char text [ ] = SaVE EArTh in 2012 ; encrypt(text); cout<<text<<endl; 6. Find the output of the following program: int U=10,V=20;

for(int I=1;I<=2;I++) cout<< [1] <<U++<< & <<V 5 <<endl; cout<< [2] <<++V<< & <<U + 2 <<endl; 7. Rewrite the following C++ program after removing the syntax error(s) if any. Underline each correction. [CBSE 2010] include<iostream.h> class FLIGHT Long FlightCode; Char Description[25]; public void addinfo() cin>>flightcode; gets(description); void showinfo() cout<<flightcode<< : <<Description<<endl; ; FLIGHT F; addinfo.f(); showinfo.f; LEVEL B 8. In the following program, find the correct possible output(s)from the options: #include<stdlib.h> randomize( ); char City[ ][10]= DEL, CHN, KOL, BOM, BNG ; int Fly; for(int I=0; I<3;I++) Fly=random(2) + 1; cout<<city[fly]<< : ; Outputs: (i) DEL : CHN : KOL: (ii) CHN: KOL : CHN: (iii) KOL : BOM : BNG: (iv) KOL : CHN : KOL: 9. In the following C++ program what is the expected value of Myscore from options (i) to (iv) given below. Justify your answer. #include<stdlib.h> randomize( ); int Score[ ] = 25,20,34,56,72,63,Myscore; cout<<myscore<<endl; i) 25 (ii) 34 (iii) 20 (iv) Garbage Value. 10. Given the following C++ code, answer the questions (i) & (ii). class TestMeOut public : ~TestMeOut() // Function 1 cout << "Leaving the examination hall " << endl; TestMeOut() // Function 2 cout << "Appearing for examination " << endl; void MyWork() // Function 3 cout << "Attempting Questions " << endl; ; (i) In Object Oriented Programming, what is Function 1 referred as and when does it get invoked?

(ii) In Object Oriented Programming, what is Function 2 referred as and when does it get invoked? LEVEL C 11. Answer the questions (i) and (ii) after going through the following class: class Seminar int Time; public: Seminar() //Function 1 Time=30;cout<< Seminar starts now <<end1; void Lecture() //Function 2 cout<< Lectures in the seminar on <<end1; Seminar(int Duration) //Function 3 Time=Duration;cout<< Seminar starts now <<end1; ~Seminar() //Function 4 cout<< Vote of thanks <<end1; ; i) In Object Oriented Programming, what is Function 4 referred 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. 12. Find the output of the following program: 3 #include <iostream.h> struct PLAY int Score, Bonus;; void Calculate(PLAY &P, int N=20) P.Score++;P.Bonus+=N; PLAY PL=10,30; Calculate(PL,10); cout<<pl.score<< : <<PL.Bonus<<endl; Calculate(PL); cout<<pl.score<< : <<PL.Bonus<<endl; Calculate(PL,15); cout<<pl.score<< : <<PL.Bonus<<endl;