Академический Документы
Профессиональный Документы
Культура Документы
M.M. 70
(a) _PolYplophism is one of the major properties of OOP. How it is implemented in C++?
(b)
2 1
Name the header files that shall be needed for the following code: void mainO char a[20]; gets(a); coutsetw(30)a; getch();
(c)
Rewrite the following program afterremoving the syntactical(s) if any. Underline each correction.
$ include <stream.h>
voidmainO
{
(d)
Find the output ofthe following program: #include <iostream.h> int &exam( int &x, int &y) if(x>y) retumy;
cout cout
"A = "a
exam(b,a)=7;
"A = "a++
public:
examO;
-examO;
void getdata(); void putdataO;
};
exam: :examO
{
cout"Function
}
1H;
exam::~examO cout"function
void mainO
2";
I.'
In the following program, find the correct possible output(s) from the options: #include <stdlib.h> #include <iostream.h> void main()
{
randomize( ); char exam [] [10]= { "PRE 1", "PRE II", PRE III", "MAIN"}; . , int f; fore int 1=2; 1>0; --I)
{
Outputs:j) PRE ii) PRE iij) PRE iv) PRE Q.2 (a) (b)
I : PRE II : PRE III : II: PRE III: PRE II: II: PRE III: MAIN: III: PRE II : PRE II :
Differentiate Multiple and multilevel inheritance in context of OOP using a suitable example illustrating each. Answer the questions (i) and (ii) after going through the following program: class match int time; public: match( int y) { time = t; } II constructor 1 match( match & t); II constructor 2 i) create an object such that it invokes constructor 1 ii) Write complete definition of constructor 2
2 2
(c)
Define a class Teacher with the following class specification: private members: name 20 characters subject 10 characters Basic, DA, HRA float salary float CalculateO function computes the salary and returns it. salary is sum of Basic, DA and HRA
Class - XII - Sub. : Computer Science (4) public members: ReadDataO function accepts the data values and invoke the calculate function. DisplayDataO function prints the data on the screen. (d) Consider the following declarations and answer the questions given below: class vehicle 4
int wheels; protected: int passanger; public: void inputdata(int,int); void outputdataO;
};
int diesel_petrol; protected: int load; public: void rcaddata(int,int); void writedataO;
};
(i)
Name the base class and derived class of the class heavy_vehicle.
(ii)
Name the data member(s) that can be accessed from function display'data. (iii) Name the data member(s) that can be accessed by an object of bus. class. (iv) Is the member function outputdata accessible to the objects of heavy_vehicle class? .
Class - XII - Sub. : Computer Science (5) Q.3 (a) Write a function in C++, which accepts an integer array and its size as parameters and swap the first half of the array with second half. Example: if an array on six elements initially contains the elements as 4, 6, 9, 1, 3, 7 then the function should rearrange the elements as 1,3,7,4,6,9. (b) An array arr[35][15] is stored in the memory along the row with each element occupying 4 bytes. Find out the base address and the address of an element arr[20] [15], if the location arr[2] [2] is stored at the address 3000. Write a function in C++ to insert an element into a dynamically allocated stack where each node contains a name as data. Assume the following definition of stack for the same. ' struct stack char ename[20]; stack* link;
};
(c)
(d)
Write a function in C++ to print the product of each row of a 2D integer array passed as the argument of the function.
2
Example: IiI 2DI Then the output should appear as: Product of Row 1: 8 Product of Row 2: 18 Product of Row 3: 24 (e)
~rrontr~ I
Evaluate the following postfix expression using a stack and show the contents of the stack after execution of each operation 2
5,11,j,8,+, 12,*,/
Q.4 (~) (b) Differentiate seekg( ) function and tellg( ) function. Write a function in C++ to print the number of lines in a text file Exam.dat, starting with letter'S'.
-~,
~,
'i .~
~.
(c)
~~
struct student char sname[20]; int roll; char dassname[ 5];
};
Write a function in C++ that would read content from the file student.dat and create a file c1ass.dat copying only those records from student.dat where the c1assname is either IX, X or XI. Q.5 (a)
~
Differentiate between cardinality and Degree of a table. Consider the following tables. \Vrite SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii) TABLE: ITElVI ITEMNO ITEMNAME RA.M3450 FLOPPY HDISK00 25 2 ITEMPRICE 2350 3500 1500 ITEMQTY
(b)
TABLE: BILLNO 1101 52 1103 45 RAM CUST_CITY 60 ITEMNO JAIPUR 1102 46 23 PARUL MUKESH RAMESH SHIVBARODA SHIV KANPUR SIKAR 34 CUST_NAME PURQTY
BILL
(i) (ii)
To display the name of all customers from BARODA. To display the itemname, itemqty from table item and purqty, cusCname from table BILL, with their corresponding matching itemno.
(iii) To display the details of all items whose itemprice is in range of 2000 and 3000. (iv) To increase the itemprice by 20% of all items. (v) SELECT DISTINCT CITY FROM BILL;
Class - XII - Sub. : Computer Science (7) (vi) SELECT COUNT(*), SUM(PURQTY) FROM BILL GROUP BY CUST _CITY; \VHERE .(vii) SELECT ITE!\1NAME, ITENIQTY, lTEMPRICE*4 FROlVl ITEM; (viii) SELECTITEMQTY,CUST~~ftJvlEFROMITEM,BILL
ITEM.ITEIV1NO
= BILL.ITEr'v1L~O.;
law in Boolean algebra.
Q.6
(a)
(b)
a. ( b' + c')
(c) Convert the following expression into its equivalent Canonical product form(SOP) sum of 2 3
(A'+B+C')(A'+B+C)(A'
(d)
e) d)
+B' +C')
Reduce the following Boolean expression using K-Map F(x,y.z.w) ~(1,2,4,5,6,12,13) Define the term Bandwidth. Give unit of Bandwidth. Expand the following terminologies:
b)
Q.7
a) c)
1 1 1
(i)
HTh1L
(i
i)
XlViL
Exam lndustries has set up its new center at Kaka Nagar for its office and web based activities. The company compound has 4 buildings as shown in the diagram below:
~~
?'.
/~~
'~
i
(Raj i1 II ~Uildin~J
II
~i!d~ II ~ Fazz
1L1~I~ .
Ii BU~~i~
If'" Jazz
...
~~
'"
I, Building '
I
I
I
I
,I
SOm
l
I I
I I
+'
60m
25m
_ Ha!sh Buil~ing Harsh Building ~! JazzBuilding to to ~'azzBlllidifig Building to Raj Jazz Building I
L--~ ~
--~l
ding lding
e 1) e2)
Suggest a cable layout of connections between the buildings. Suggest the most suitable place (i.e. building) to house the server of this or2:anisation with a suitable reason. u Suggest the placement of the following devices with justification: (i) Internet Connecting Device/Modem Oi) Switch
1
1
e3)
e4)
The organisation is planning to link its sale counter situated in various parts of the same city, which type of network out of LAN, MAN or WAN will be formed? Justify your answer. ,"
( I
V
c.
'.
KVS(AR)