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

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

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

Come and join us at WebLyceum

COMPUTER SCIENCE (083)

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

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

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

HOLIDAYS HOMEWORK CLASS : XII. Subject : Computer Science

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

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

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

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

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

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

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

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

CBSE 12th Computer Science Question Papers

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

CLASS-XI COMPUTER SCIENCE

Programming in C++ The manager of a company. Lecture Notes 6. Functions (Procedures) 4/24/2018. he he he. Does Does Does

DELHI PUBLIC SCHOOL BOKARO STEEL CITY ASSIGNMENT FOR THE SESSION

Arrays. Week 4. Assylbek Jumagaliyev

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

AAA //Members of AAA }; class BBB: public AAA //intermediate class. BBB { //Members of BBB };

Sample Paper Class XII SUBJECT : COMPUTER SCIENCE

STRUCTURED DATA TYPE ARRAYS IN C++ ONE-DIMENSIONAL ARRAY TWO-DIMENSIONAL ARRAY

Quiz Start Time: 09:34 PM Time Left 82 sec(s)

For Teacher's Use Only Q No Total Q No Q No

CS201 Latest Solved MCQs


LAB 4.1 Relational Operators and the if Statement

Lab 2: Pointers. //declare a pointer variable ptr1 pointing to x. //change the value of x to 10 through ptr1

Tutorial Letter 103/1/2017 Introduction to Programming I

CMSC 202 Midterm Exam 1 Fall 2015

Computer Department. Question (1): State whether each of the following is true or false. Question (2): Select the correct answer from the following:

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

Object Oriented Pragramming (22316)

AC55/AT55 OBJECT ORIENTED PROGRAMMING WITH C++ DEC 2013

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 =

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010

Programming in C++: Assignment Week 1

Programming. C++ Basics

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

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

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

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

CS 7B - Spring Final Exam

C++ Structures Programming Workshop 2 (CSCI 1061U)

EAS 230 Fall 2002 Section B

Answer Key with Marking Scheme

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

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

KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION FIRST COMMON PRE BOARD EXAMINATION

COMPUTER SCIENCE(083) SAMPLE QUESTION PAPER CLASS XII

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

Midterm Exam #2 Spring (1:00-3:00pm, Friday, March 15)

DELHI PUBLIC SCHOOL BOKARO STEEL CITY

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

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

COMPUTER SCIENCE (083)

CS Introduction to Programming Midterm Exam #2 - Prof. Reed Fall 2015

Question Bank Class XII Subject : Computer Science

This chapter introduces the notion of namespace. We also describe how to manage input and output with C++ commands via the terminal or files.

CSCI 1370 APRIL 26, 2017

Short Notes of CS201

COMPUTER SCIENCE 1998 (Delhi Board)

Collected By Anonymous

SHORT REVIEW OF CS TOPICS RANDOM NUMBERS (2 MARKS) which generates a random number in the range of 0 to n-1. For example;

Chapter 01 Arrays Prepared By: Dr. Murad Magableh 2013

BEng (Hons) Electronic Engineering. Resit Examinations for / Semester 1

Review Questions for Final Exam


COL 100. Minor 2 Exam - Practice

CS201 - Introduction to Programming Glossary By

Kingdom of Saudi Arabia Princes Nora bint Abdul Rahman University College of Computer Since and Information System CS242 ARRAYS

Object Oriented Programming Using C++ UNIT-3 I/O Streams

CPT101- Principles of Programming

COMPUTER SCIENCE

DISK FILE PROGRAM. ios. ofstream

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

COMS W3101 Programming Language: C++ (Fall 2016) Ramana Isukapalli

COMPUTER SCIENCE SAM PLE PAPER 2-HALF YEARLY EXAMINATION

(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

ECE264 Fall 2013 Exam 1, September 24, 2013

List of Practical for Class XII Computer Science

Fast Introduction to Object Oriented Programming and C++

Computer Science 330 Assignment


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

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

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

Chapter 14 Sequential Access Files

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

SUBMITTED AS A PART OF C.B.S.E. CURRICULUM FOR THE YEAR

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

6.096 Introduction to C++ January (IAP) 2009

Come and join us at WebLyceum

Classes and Objects. Instructor: 小黑

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

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

Transcription:

I Mid Semester May 01 : Class XII : Computer Science Max Mark 50 : Time Hrs 1. a) What is macro in C++? Give example b) Give the Header file for the following functions:- i) gets ( ) ii) tolower( ) 1 c) Rewrite the following program after removing syntax errors. Underline each correction. # include <iostream. h > one = 10, two = 0 ; call ( one ; two ) ; call ( two ) ; void call ( int a ; int b = 0 ) cout<< a << <<b << endl ; d) What is a Pointer? 1 e) Find the output of the following program segment : - # include <iostream.h> int * a, m [ ] = 10, 0, 0, 0 ; a = m ; m [ ] + = 0 ; cout << First = << * a << endl ; * a - = 10 ; a + = ; cout << Second = << * a << endl ; a++ ; cout << Third = << * a << endl ; cout << Forth = << m [ 0 ] << endl ; f) Find the output of the following program segment : - float cal ( int & x ) return 0.5 * ++ x ; float cal ( int & x, int y ) return x++ * y ; int a = 9, b = 5 ; cout << cal ( a, b ) << endl << cal ( b, cal ( a ) ) << endl ; cout << a << endl << b << endl ; 1

g) In the following program, find out which output (s) from the options given will not be expected from the program? # include <iostream. h > # include <stdlib.h> options : - randomize ( ); i ) 9 # 6 # int arr[ ] = 9, 6, N ; ii ) 19 # 17 # int change = random ( ) + 10 ; iii ) 19 # 16 # for( int c = 0 ; c < : c++ ) iv ) 0 # 16 # N = random ( ) ; cout << arr [ N ] + change << # ;. a) Rewrite the following program after removing syntax errors. Underline each correction. structure student int no = 10 ; char name [0] ; float fees ; ; st studuent ; cin >> st.name ; cout<< fees ; b) Find the output of the following program struct matrix int row, col ; ; void Print ( matrix p) cout << p. row << <<p.col << endl; void Cal ( matrix & A, matrix B ) A.row + = B.col ++ ; A.col + = ++ A.row + B.col ; matrix X =,6, Y = 7, 9 ; Cal ( X, Y ) ; Cal ( Y, X ); Print ( X ) ; Print (Y) ;. a) What is Data Abstraction? Explain with suitable example. b) Give two differences between Constructor and member function. Give example.

c) Rewrite the following program after removing errors. Underline the corrected statements. class sample ( ) int a, b ; void calculate ( ) ; sample ( ) ; void input ( ) ; void output ( ) ; s ; void input ( ) cin >> x >> y ; s. input ( ) ; output ( ) ; d) Consider the following class declaration and answer the following questions. class games int code; char name [ 0 ]; float charges ; games ( int cd, char nm [ ], float amt ) ; // function 1 games ( games & s ) ; // function ; i) Write statement to access function 1. ii) Write the function definition for function. ( Body of the function ) e) Define a class tour for the following descriptions:- Private members: Tourcode integer ( in the range of 1000 9000) Place string Nooftravelers integer Cost float Public member functions :- Accept ( ) a function to input values of all data members except cost. Calcost ( ) a function to calculate the cost based on following conditions. Cost = nooftravelers * 75.Give 5% discount if the no of travelers are more than 0 and less than 0. 7 % discount for 0 and more. Display ( ) a function to print all the data members.. a) Consider the following classes and answer the following questions : - class company int no [10] ; char Oname[10][0] ; company ( ) ; void input_one ( ) ; void output_one ( ) ; ;

class factory : protected company int no ; factory ( ) ; void input_two ( ) ; void output_two ( ) ; char Tname [ 5 ]; double a, b; ; class shop : public factory double T; void cal ( ) int t = a + b ; shop ( ) ; void display ( ); void Accept ( ) ; ; i) What will be the size of objects declared based on classes factory and shop? ii) Name the data members that can be accessed by the member function display( ). iii) Name the inherit member functions factory? iv) write the classes in which the data member Oname can be accessed? b) Consider the following class : class school int rollno ; char sname[0] ; float marks ; void result ( ) ; school ( ) ; void Enroll ( ) ; void Display ( ); ; class college long Tcode ; char Tname [ 0 ] ; float salary ; college ( ) ; void Enter ( ) ; void show ( ) ; ;

class university : public college, private school long ccode [ 10 ] ; char course [ 0 ] ; char startdate [ 8 ], enddate [ 8 ] ; university ( ) ; void commence ( ) ; void detail ( ); ; i) Name the member functions, which are accessible from objects of class university. ii) Name the data members, which are accessible from member function commence. iii) What is the size of object declared based on class college and university? iv) Which constructor will be accessed first when the object is declared based on class university? 5. a) Consider the following class stationary. class stationary int code ; char itemname [ 0 ]; float cost ; void input ( ) cin >> code >> itemname >> cost ; vod output ( ) cout<<code <<itemname<<cost ; int retcode ( ) return code; ; A binary file store.dat consists of records of stationary type. Write a function to display of a particular item when the code is accepted in the function. print error message if the search is unsuccessful. b) Consider a text file book.txt and write a function to copy all the words which are starting with a vowel onto a new file Newbook.txt. c) Consider a following program segment, which involves to find the number of records in a binary file, where each record is of the type employee. void count ( ) ifstream file( emp.dat,ios : : binary ) ; file.( ); cout<< Number of Records = << ; d) Consider the following structure product struct product char code ; char description [0] ; float price ; ; write a function to increase the price by 10 % for a particular item of a binary file "stock.dat" when the code is accepted in the function. Modify the record without using temporary file. e) What is the similarity and difference between ios::app and ios :: out? 5

I Mid Semester Exam May 01 Class XII (Computer Science ) Answer Key 1. a) 1 mark for explanation and 1 mark for any examples b) ½ mark for each correct output i) gets <stdio.h> ii) tolower <ctype.h> c) ½ mark for each error marks d) 1 marks For correct definition e) With working for correct answer marks First = 10 Second = 50 Third = 0 Forth = 0 f) With working for correct answer marks 60 5 11 6 g) mark for correct answer with justification. a) ½ mark for each error marks b) ½ mark for each correct answer, marks, 1 mark for working 1 9 7 76. a) 1 mark for definition, 1 mark for example b) 1 mark for differences and 1 mark for example. c) ½ mark for each error marks d) 1 mark for each correct answer, marks e) 1 mark for class declaration 1 mark1 for each function, marks. a) 1 mark for each correct answer marks b) 1 mark for each correct answer marks 5. a) ½ mark for opening the file m, ½ mark for closing the file 1 mark for loop and local variable declaration, 1 mark for body of program b) ½ mark for opening the file, ½ mark for closing the file 1 mark for loop and local variable declaration, 1 mark for body of program c) 1 mark for each correct answer void count ( ) ifstream file( emp.dat,ios : : binary ) ; file. seekg( 0,ios:: end ); cout<< Number of Records = << fob.tellg ( ) / sizeof (employee); d) ½ mark for opening the file m, ½ mark for closing the file 1 mark for loop and local variable declaration, 1 mark for body of program e) 1 mark for similarity and 1 mark for difference. 6