ASSIGNMENT CLASS : XII ( ) COMPUTER SCIENCE

Similar documents
COMPUTER SCIENCE Sample Paper I

Computer Science (Code 083) Sample Paper with Solution Set II

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

(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 (Code 083) Sample Paper with Solution Set II

Kendriya Vidyalaya Sangathan MODEL QUESTION PAPER - 2 Class-XII Subject: Computer Science (083) Time 3 hrs MM 70

Sample Paper 2012 Class XII Subject COMPUTER SCIENCE (Theory)

COMPUTER SCIENCE(083) SAMPLE QUESTION PAPER CLASS XII

void main() { int global=7 ; func( ::global,global) ; cout<<global<<, <<::global<< \n ; func(global,::global) ; cout<<global<<, <<::global<< \n ; }

COMPUTER SCIENCE (Theory) - Class XII Sample Question Paper II Subject Code - 083

KENDRIYA VIDYALYA CLRI COMPUTER SCIENCE XII WORKSHEET ON OUTPUT QUESTIONS

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

Downloaded from

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

KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION FIRST COMMON PRE BOARD EXAMINATION

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

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


CLASS XII COMPUTER SCIENCE(083) TimeAllowed : 3 HrsMax Marks : 70

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

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

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

Session Chapter 4: Classess & Object

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

ITL Public School First Term( )

List of Practical for Class XII Computer Science

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

BRAIN INTERNATIONAL SCHOOL. Computer Science Assignment CLASS XII OCTOBER 2018 Chapter-7. Data File Handling in C++ Text Files

KENDRIYA VIDYALAYA SANGATHAN TINSUKIA REGION PRE BOARD EXAMINATION SUBJECT COMPUTER SCIENCE

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

DELHI PUBLIC SCHOOL BOKARO STEEL CITY ASSIGNMENT FOR THE SESSION

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

DELHI PUBLIC SCHOOL, RUBY PARK, KOLKATA CLASS XII SUBJECT: COMPUTER SCIENCE QUESTION BANK FILE HANDLING:-

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

Constructor & Classes Questions

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

EAS 230 Fall 2002 Section B

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

Sample Paper I Class XII

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

COMPUTER SCIENCE 1998 (Delhi Board)

KENDRIYA VIDAYALAYA PANGODE MONTHLY TEST AUGUST 2015

KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION COMPUTER SCIENCE (083)

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

COMPUTER SCIENCE (083)

Sample Paper, 2015 Subject: Computer Science Class 12 th

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

HOLIDAYS HOMEWORK CLASS : XII. Subject : Computer Science

Downloaded from

Model Sample Paper 2015

CLASS XII GUESS PAPER COMPUTER SCENCE (083)

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

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

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

Sample Paper Class XI Subject Computer Sience UNIT TEST II

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

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

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

COMPUTER SCIENCE (083)

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

KendriyaVidyalayaSangathan Kolkata Region

Computer Science 2006 (Delhi)

Computer Science 2006 (Outside Delhi)

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

After going through this lesson, you would be able to: store data in a file. access data record by record from the file. move pointer within the file

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 =

QUESTION BANK SUB: COMPUTER SCIENCE(083)

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

BLUE PRINT SUBJECT: - COMPUTER SCIENCE(083) CLASS-XI. Unit Wise Marks

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


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; }

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


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:

DELHI PUBLIC SCHOOL BOKARO STEEL CITY

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

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

DATA FILE HANDLING. The function should create another file OUT.TXT with the text

Informatics Practices - Assignments. A Practical Workbook

Sample Paper 2012 Class XII Subject Computer Science

Computer Science, Class XII, Chapter No.7 (Data File Handling)

Scheme G. Sample Test Paper-I. Course Name : Computer Engineering Group Course Code : CO/CD/CM/CW/IF Semester : Second Subject Tile : Programming in C

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

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

(1)Given a binary file PHONE.DAT, containing records of the following structure type class Phonlist { char Name[20]; char Address[30]; char

COMPUTER SCIENCE (Theory) - Class XII Marking Scheme

THE INDIAN COMMUNITY SCHOOL, KUWAIT

SAMPLE PAPER-2015 CLASS-XII COMPUTER SCIENCE. Sample paper-i. Time allowed: 3 hours Maximum Marks: 70 Name : Roll No.:

Unit-V File operations

(b) Rewrite the following program after removing the syntactical errors (if any). Underline each correction. 2

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

POINTERS. Pointer is a memory variable which can store address of an object of specified data type. For example:

ios ifstream fstream

Computer Science XII Important Concepts for CBSE Examination Questions

Chapter-11 POINTERS. Important 3 Marks. Introduction: Memory Utilization of Pointer: Pointer:

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

CBSE Sample Paper for Computer Science Class XII.

Sample Paper, Subject: Computer Science Class 12 th Time Allowed : 3 Hr. M.M.: 70

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

Transcription:

ASSIGNMENT CLASS : XII (2015-16) COMPUTER SCIENCE Short answer typequestions: 1.(a)What is the difference between logical error and runtime error? Give suitable example for the same. (b) What is the difference between Global Variable and Local Variable? (c)differentiate between type casting and type promotion with suitable example. (d) What is the difference between call by value and call by reference? Give an example in C++ to illustrate both. (e)what is the difference between Object Oriented Programming and Procedural Programming? (f)what do you understand by Polymorphism? Give a suitable example of the same. (g)what do you understand by Data Encapsulation and Data Hiding? (h) Differentiate between public and private visibility modes in context of Object Oriented Programming using a suitable example illustrating each. (i) How are data abstraction and data encapsulation inter-related? (j) Differentiate between a runtime error and syntax error. Also give suitable example of each in c++. Find Header Files For The Following 2.(a) Write the names of the header files to which the following belong: (i) setw() (ii) sqrt() (b) Name the header files that shall be needed for the following code. char str*+= air force schools ; cout<<setw(20)<<str; (c) Write the names of the header files to which the following belong: (i) setw() (ii) toupper() (d) Write the names of the header files to which the following belong : (i) frexp() (ii) isalnum() (e) Name the header file required for the following functions: (i) sqrt() (ii) setw() (iii) pow() (iv)clrscr()

Find Out Errors 3. (a) Rewrite the following program after removing the syntactical errors (if any). #include <iostream.h> struct Pixels intcolor,style; voidshowpoint(pixels P) cout<<p.color,p.style<<endl; Pixels Point1=(5,3); ShowPoint(Point1); Pixels Point2=Point1; Color.Point1+=2; ShowPoint(Point2); (b) #include<iostream.h> int x, sum=0; cin<<n; for(x=1,x<100,x+=2) if x % 2 ==0 sum +=x; cout<< sum = >>sum; (c ) #include [iostream.h] class PAYITNOW int Charge; PUBLIC: void Raise()cin>>Charge; void Showcout<<Charge;

; PAYITNOW P; P.Raise(); Show(); (d ) #include<iostream.h> int x, sum=0; cin<<n; for(x=1,x<100,x+=2) if x % 2 ==0 sum +=x; cout<< sum = >>sum; (e ) #include<iostream.h> #define num=10 class MEMBER int Mno; float fees=0; PUBLIC: void Register()cin>>Mno>>fees; void Display()cout<<Mno<< : <<fees<<endl; ; 4. Find the outputs (a) Give the output of the following program #include<iostream.h> int a=3; void demo(int x,int y,int &z) a+= x+y ; z= a+y; y+=x; cout<<x<<y<<z<<endl; int a=2, b=5; demo(::a,a,b); cout<<::a<<a<<b<<endl; demo(::a,a,b); (b)write the output of the following program. # include <iostream.h> void execute (int &x, int y=200)

int temp = x + y; x += temp; if( y!=200) cout<<temp<<x<<y<<endl; int a=50, b=0; execute(b); cout<<a<<b<<endl; execute(a,b); cout<<a<<b<<end; (c) Find the output of the following program # include<iostream.h> struct play int score, bonus; ; void calculate ( play &p, int n=10) p.score ++ ; p.bonus +=n; play pl=10,15; calculate (pl,5); cout<<pl.score<< : <<pl.bonus<<endl; calculate(pl); cout<<pl.score<< : <<pl.bonus<<endl; calculate(pl,15); cout<<pl.score<< : <<pl.bonus<<endl; (d) #include <iostream.h> void Changethecontent(int Arr[], int Count) for (int C=1;C<Count;C++) Arr[C-1]+=Arr[C]; int A[]=3,4,5,B[]=10,20,30,40,C[]=900,1200; Changethecontent(A,3); Changethecontent(B,4); Changethecontent(C,2); for (int L=0;L<3;L++) cout<<a[l]<< # ; cout<<endl; for (L=0;L<4;L++) cout<<b[l] << # ; cout<<endl; for (L=0;L<2;L++) cout<<c[l] << # ; (e) Find the output of the following program: #include <iostream.h>

struct Game char Magic[20];int Score; ; Game M= Tiger,500; char *Choice; Choice=M.Magic; Choice[4]= P ; Choice[2]= L ; M.Score+=50; cout<<m.magic<<m.score<<endl; Game N=M; N.Magic[0]= A ;N.Magic[3]= J ; N.Score-=120; cout<<n.magic<<n.score<<endl; (f) #include<iostream.h> void main( ) long NUM=1234543; int F=0,S=0; do int R=NUM % 10; if (R %2!= 0) F += R; else S += R; NUM / = 10; while (NUM>0); cout<<f-s; (g) Find the output of the following program. #include<iostream.h> #include<ctype.h> void Mycode(char Msg[],char ch) for(int cnt=0;msg[cnt]!='\0';cnt++) if(msg[cnt]>='b'&& Msg[cnt]<='G') Msg[cnt]=tolower(Msg[cnt]); else if(msg[cnt]=='a' Msg[cnt]=='a') Msg[cnt]=ch; else if(cnt%2==0) Msg[cnt]=toupper(Msg[cnt]); else Msg[cnt]=Msg[cnt-1]; char MyText[]="ApEACeDriVE"; Mycode(MyText,'@'); cout<<"new TEXT: "<<MyText<<" "<<endl;

(h) Find the output of the following program. #include<iostream.h> struct POINT int X, Y, Z; ; void StepIn( POINT & P, int Step = 1) P.X += Step; P.Y -= Step; P.Z += Step; void StepOut ( POINT & P, int Step = 1) P.X -= Step; P.Y += Step; P.Z -= Step; POINT P1 = 15, 25, 5, P2 = 10, 30, 20; StepIn(P1); StepOut(P2, 4); cout<<p1.x<<, <<P1.Y<<, <<P1.Z<<endl; cout<<p2.x<<, <<P2.Y<<, <<P2.Z<<endl; StepIn (P2, 12); cout<<p2.x<<, <<P2.Y<<, <<P2.Z<<endl; (i) Find the correct possible output(s) of the following program from the options given below. #include<iostream.h> #include<stdlib.h> randomize(); char color*+*10+=, RED, BLUE, PINK, BLACK -; int p; for( int i=1; i<=3; i++) p=random(2) +1; cout<<color*p+<< : ; Outputs: (i) BLUE:PINK:BLUE (ii) RED:BLUE:PINK (iii) BLUE:PINK:BLACK (iv) BLUE:PINK:PINK (j) Find the output of the following program. #include<iostream.h> #include<string.h> #include<ctype.h> void main ( )

char str[]= Good@luck10! ; for( int c=0; c<strlen(str); c++) if(islower(str[c])) str[c]=toupper(str[c]); else if(isupper(str[c])) str[c]=tolower(str[c]); else if(isdigit(str[c])) str[c]=str[c] + 1; else str[c]= * ; cout<<str; 5. Class Completion Questions: (a) Define a class STUDENT with following specifications private members rollno integer name character array of size 20 clas character array of size 5 marks integer array of size 5 per float // percentage calculate() // calculates overall percentage & returns the percentage public member/member functions readmark() to read the required input & invoke calculate() function displaymark() to display all details (b) Define a class in C++ with following description: Private Members A data member Flight number 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 Distance Fuel <=1000 500 more than 1000 and <=2000 1100 more than 2000 2200 Public Members A function FEEDINFO() to allow user to enter values for Flight Number, Destination, Distance & call the function CALFUEL() to calculate the quantity of Fuel A function SHOWINFO() to allow user to view the content of all the data members

(c ) Define a class batsman with the following specifications: Private members: bcode bname 4 digits code number 20 characters innings, notout, runs integer type batavg, batavg =runs/(innings-notout) calcavg() Public members: readdata() it is calculated according to the formula Function to compute batavg Function to accept value from bcode, name, innings, notout and invoke the function calcavg() displaydata() Function to display the data members on the screen. (d ) Define a class Clothing in C++ with the following descriptions : Private members : Code of type string Type of type string Size of type integer Material of type string Price of type float A function CalcPrice() which calculates and assigns the value of Price as follows : For the value of Material as Cotton Type Price (Rs.) Trouser 1500 Shirt 1200 For material other than Cotton the above mentioned Price gets reduced by 15%. Public Members : A constructor to assign initial values of Code, Type and Material with the word NOT ASSIGNED and Size and Price with 0. A function Enter() to input the values of the data members Code, Type, Size and Material and invoke the CalcPrice() function. A function Show() which displays the content of all the data members of Clothing. 5. (a) What is the difference between get() and read(). (b) What is the difference between app and ate mode of opening a file. (c) Name two member functions of ofstream class. (except open and close) (d) What is the output if the file content before the execution of the program is the string ABC ( Note that are not part of the file) char ch= a ; fstream fileout( data.dat,ios::out); fileout<<ch; int p = fileout.tellg(); cout<<p;

(e) Consider the following class declaration: class employee int code; char name[20]; float salary; public: void input() cin>>code>>name>>salary; void show() cout<<code<<name<<salary; float retsal() return salary ; ; Give function definitions to do the following: (i)write the objects of employee to a binary file. (ii)read the objects of employee from the binary file and display all the objects on the screen whose salary is between Rs. 10000 and Rs. 20000. (f) Observe the program segment given below carefully and fill the blanks marked as Statement 1 and Statement 2 using seekg() and tellg() functions for performing the required task. #include <fstream.h> class Employee int Eno;char Ename[20]; public: //Function to count the total number of records int Countrec(); ; int Employee::Countrec() fstream File; File.open( EMP.DAT,ios::binary ios::in); //Statement 1 int Bytes = //Statement 2 int Count = Bytes / sizeof(employee); File.close(); return Count; (g) Write a function in C++ to count the words this and these present in a text file NOTES.TX (h) Write a function in C++ to add new objects at the bottom of a binary file STUDENT.DAT, assuming the binary file is containing the objects of the following class. class STUD int Rno; char Name[20]; public: void Enter()cin>>Rno;gets(Name); void Display()cout<<Rno<<Name<<endl; int Return_Rno() return Rno; ;

(i)write a function in C++ to delete an object from a binary file STUDENT.DAT, assuming the binary file is containing the objects of the class STUD whose definition is given in Q. 6(c). The Rno of the object to be deleted will be passed as an argument.