web viewsk. #include class employee {int eno;char ename[20]; ... what do you mean by spam mails?...
TRANSCRIPT
KENDRIYA VIDYALAYA SANGATHAN, REGIONAL OFFICE, RAIPURdsUæh; fo|ky; laxBu] {ks=h; dk;kZy;] jk;iqj
2 st Pre Board Examination दूसरा izh&cksMZ ijh{kk Session l= :- 2014-2015 Class d{kk :- XII th
ckjgohaCOMPUTER SCIENCE (Theory)
TIME : 3 Hrs MM : 70
No. Questions
Marks
1.
(a)
(b)
(c)
What is the difference call by value and call by reference with respect to memory allocation ?Give suitable C++ code to illustrate both.
Which C++ header file(s) will be essentially required to be included to run /execute the following C++ code:
void main()
{
char name[20];cin >>name;
cout<<(char)toupper( name[0] ) <<” for “<<setw(25)<<name;
}
Rewrite the following program after removing the syntactical errors (if any). Underline each correction.#include<iostream.h>#include<stdio.h>class MyStudent{int StudentId = 875; char Name[20]; public:MyStudent (){}void Register(){cin>> StudentId;gets name}void Display(){ cout << StudentId<<”,”<<name<<endl;}};void main(){MyStudent MS Register.MS; MS.display();}
2
1
2
No. Questions Marks
(d)
(e)
Find the output of the following program:#include<iostream.h>void ChangetheContent(int Arr[], int Count){
for(int C=0; C<Count; C++) Arr[C]= Arr[Count – C- 1];}void main(){
int A[]= {1, 2, 3}, B[] = {20, 30, 40, 50}, C[]= {100, 200}; 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]<<‟#‟;cout<<endl;
}
Find the output of the following program:
void main(){char a[]= “CBSE -2015 AheAd”;int i;for(i=0; a[i]!= „\0‟;i++){
if(a[i]>= 97 && a[i]<=122)a[i] --;
elseif(a[i]>= „0‟ && a[i]<= „9‟)
a[i] = a[i -1];else
if(a[i]>= „A‟ && a[i]<= „Z‟)a[i]+ = 32;
elsea[i]= „#‟;
}puts(a);
}
3
2
No. Questions Marks
(f) In the following program, what will be the expected output(s) from the following options (i), (ii), (iii) and (iv)?
#include <iostream.h>
#include <stdlib.h>
void main()
{
randomize();
int x=788,y=45;
int a=random(3)+4;
int b=random(2)+2;
for(int i=0;i<a; i++) cout<<‟@‟;
cout<<x<< ”,” ;
for(i=0;i<b ; i+
+) cout<<”$”;
cout<<y<<endl;
}
(i) @@@788,$ 45
(ii) @@788,$$ 45
(iii) @@@@@@788,$$ 45
(iv) @@@@788,$$$$ 45
2
No. Questions Marks
2.
(a)
(b)
i)
ii)
c)
What do you understand by Polymorphism? Also, give a suitable C++ code
. Answer the questions (i) and (ii) after going through the following class:
class Birds{ public:
char category[20];Birds( char bname[]) // function1{
strcpy(category, bname) //function2}Birds(Birds &t);
};
In Object Oriented Programming, Create an object, such that it invoke
function1. In Object Oriented Programming, Write complete definition for
function2.
Define a class FLIGHT in C++ with following description: Private Members
A data member Flight number of type integerA data member Destination of type stringA data member Distance of type floatA data member Fuel of type float
A member function CALFUEL() to calculate the value of Fuel as per the following criteriaDistance Fuel<=1000 500 more than 1000 and <=2000 1100 more than 2000 2200
Public MembersA function FEEDINFO() to allow user to enter values for Flight Number, Destination, Distance & call function CALFUEL() to calculate the quantity of FuelA function SHOWINFO() to allow user to view the content of all the data members
2
2
4
No. Questions Marks(d)
(i)
(ii)
(iii)
(iv)
Answer the questions (i) to (iv) based on the following:
class CUSTOMER{
int Cust_no;char Cust_Name[20];
protected:void Register();
public: CUSTOMER(); void Status();
};class SALESMAN{
int Salesman_no;char Salesman_Name[20];
protected:float Salary;
public: SALESMAN(); void Enter(); void Show();
};class SHOP : private CUSTOMER , public SALESMAN{
char Voucher_No[10];char Sales_Date[8];
public: SHOP();void Sales_Entry();void Sales_Detail();
};
Write the names of data members which are accessible from objects belonging to class CUSTOMER.
Write the names of all the member functions which are accessible from objects belonging to class SALESMAN.
Write the names of all the members which are accessible from member functions of class SHOP.
How many bytes will be required by an object belonging to class SHOP?
4
No. Questions Marks3(a)
(b)
(c )
(d)
(e)
4. (a)
Write a function in C++ to combine the contents of two equi-sized arrays A a nd B by computing their corresponding elements with the formula 2*A[i]+3*B[i]; where value i varies from 0 to N-1 and transfer the resultant content in the third same sized array
An array S[40][30] is stored in the memory along the row with each of the element occupying 2 bytes, find out the memory location for the element S[20][10], if the Base Address of the array is 5000.
Write a function in C++ to perform Insert operation in a dynamically allocatedQueue containing names of employees.
Write a function in C++ to find the sum of both left and right diagonal elements from
a two dimensional array (matrix).
Evaluate the following postfix notation of expression:
20, 30, +, 50, 40, - ,*
Observe the program segment given below carefully and fill the blanks marked as Statement 1 and Statement 2 using seekp() and seekg() 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 intCountrec();
};int Item::Countrec(){
fstream File;File.open(“EMP.DAT”,ios::binary|ios::in);
; //statement 1 int Bytes = ; //statement 2 int Count = Bytes / sizeof(Item);File.close();return Count;
}
3
3
4
2
2
1
(b)
(c )
5(a)5(b)
Write a function in C++ to count the number of uppercase alphabets present in atext file “ ARTICLE.TXT”
Given a binary file TELEPHON.DAT, containing records of the following classDirectory :
class Directory{char Name [20] ; char Address [30] ; char AreaCode[5] ; char Phone_No[15] ; public :void Register ( ) ;void Show ( ) ;int CheckCode (char AC [ ] ){return strcmp ( AreaCode , AC ) ;}};Write a function COPYABC ( ) in C++ , that would copy all those records havingAreaCode as “123” from TELEPHON.DAT to TELEBACK.DAT.
Define Foreign key and Candidate key.Consider the following table Organisation and Grossincome and answer (I) and(II) part of the question
Table: ORGANISATION
2
3
2
ECODE NAME POST SGRADE DOJ
2001 AJAY GENERAL MANAGER D003 23-Mar-20032002 VIJAY EXECUTIVE MANAGER D002 12-Feb-20102003 RAM DEPUTY MANAGER D003 24-Jan-20092004 RAHIM PROD. INCHARGE D002 11-Aug-20062005 ABBAS ADD.GENERAL
MANAGERD001 29-Dec-2004
Table:GROSSINCOME
SGRADE SALARY HRAD001 56000 18000D002 32000 12000D003 24000 8000
(b)(I)
(II)
6(a)
(b)
(c)
Write SQL commands for the following statements: 4
(i) To display the details of all MEMBERS OF ORGANISATION in descending order of DOJ. (ii) To display NAME and POST of those MEMBERS whose SGRADE is either D002 or D003.(iii) To display the content of all the ORGANISATION table, whose DOJ is in between 09-Feb-2006 and 08-Aug-2009.(iv) To add a new row with the following
2007, ‘RUDRA’, ‘SALES INCHARGE’, ‘D002’,’26-Sep-2011’,
Give the output of the following SQL queries
2 (i) SELECT COUNT(SGRADE), SGRADE FROM ORGANISATION GROUP BY
SGRADE;(ii) SELECT MIN(DOB), MAX(DOJ) FROM ORGANISATION;(iii) SELECT NAME,SALARY FROM ORGANISATION O, GROSSINCOME
G WHERE O.SGRADE=G.SGRADE AND O.ECODE<{‘01-01-2006’},(iv) SELECT SGRADE, SALARY+HRA FROM GROSSINCOME
WHERE SGRADE=’D002’;
State and algebraically prove the Absorption law. 2
Draw the circuit diagram for 2F(a,b,c)=AB+BC+CD using NAND to NAND logic.
Write SOP form of Function F(x,y,z) whose truth table representation is given 1below:
x y z F0 0 0 00 0 1 00 1 0 10 1 1 01 0 0 11 0 1 01 1 0 11 1 1 1
(d)
7(a)
(b)
(c )
(d)
(e)
Reduce the following Boolean Expression using K-Map: F(U,V,W,Z)=(0,1,2,4,5,6,8,10)
Define the term Bandwidth. Give unit of
Bandwidth. Expand the following terminologies:(i) SIM (ii) XML
Define the term firewall.
What do you mean by IP Address? How is it useful in Computer Security?
ABC Systems Organisation has set up its new center at Jabalpur for its office and web based activities.It has 4 blocks of buildings as shown in the diagram below.
3
1
1
1
1
FAZZ RAJ
HARSH JAZZ
Center to center distances between various buildings is as follows:
Harsh Building to Raj Building 50
mRaz Building to Fazz Building 60 mFazz Building to Jazz Building 25 mJazz Building to Harsh Building 170 mHarsh Building to Fazz Building 125 mRaj Building to Jazz Building 90 m
Number of Computers in each of the buildings is follows:
Harsh Building 15Raj Building 150Fazz Building 15Jazz Bulding 25
e1)
e2)
e3)
1Suggest a cable layout of connections between the buildings.
Suggest the most suitable place (i.e. building) to house the server of this 1
organisation with a suitable reason.
Suggest the placement of the following devices with justification:
1 (i) Internet Connecting Device/Modem (ii) Switch
e4) The organisation is planning to link its sale counter situated in various parts of thesame city, which type of network out of LAN, MAN or WAN will be formed? 1Justify your answer.
(f)
(g)
What do you mean by Spam Mails? How can you protect your mailbox from Spams? 1
Define Open Source Software with example.. 1