0% found this document useful (0 votes)
117 views7 pages

Class Xii Computer Science (083) : General Instructions - (I) All Questions Are Compulsory (Ii) Programming Language: C++

This document contains questions from the Computer Science subject for Class XII. It includes questions on C++ programming concepts like break and continue statements, header files, syntax errors, output of code segments, classes and objects. It also has questions on data structures like stacks and arrays. SQL queries on tables and Boolean algebra questions are included. The last part provides a network diagram and asks questions to suggest the most suitable network layout and components for connecting multiple office blocks of a company.

Uploaded by

Aditya Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
117 views7 pages

Class Xii Computer Science (083) : General Instructions - (I) All Questions Are Compulsory (Ii) Programming Language: C++

This document contains questions from the Computer Science subject for Class XII. It includes questions on C++ programming concepts like break and continue statements, header files, syntax errors, output of code segments, classes and objects. It also has questions on data structures like stacks and arrays. SQL queries on tables and Boolean algebra questions are included. The last part provides a network diagram and asks questions to suggest the most suitable network layout and components for connecting multiple office blocks of a company.

Uploaded by

Aditya Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

1

CLASS XII COMPUTER SCIENCE(083)


TimeAllowed : 3 HrsMax Marks : 70

General Instructions- (i) All questions are compulsory


(ii) Programming Language: C++
1.

(a)Differentiatee between break and continue statements.


(b)Observe the following code and write the name(s) of the header files essentially required
to compile it.
void main()
{
charch; cin>>ch;
int x=isdigit(ch);
if(x)
cout<<It is a digit;
}
(c) Find out the syntax errors (if any) in the following program. (Assuming all the required
header files are included.)
typedef char[30] string;
void main()
{
string s;
for(i=0,i<10,i++)
s[i]=65+i;
s[i]="\0";
cout<<s;
}
(d) Find the output of the following program.
#include<iostream.h>
void main()
{
int a[]={5,10,15,20,25,30};
int *p=a+3;
for(inti=0;i<3;i++)
{
p[i]=a[i];
a[i]=p[i]*2;
}
for(i=0;i<6;i++)
cout<<*(a+i)<<" ";
}

2
1

(e)

Find the output of the following program.


#include <iostream.h>
#include<string.h>
void encode(char S[ ])
{
int L=strlen(S);
for (int C=0;C<L/2;C++)
if (S[C]=='A' || S[C]=='E')
S[C]='#';
else
{
char T=S[C];

2.

S[C]=S[L-C-1];
S[L-C-1]=T;
}
}
void main()
{
char Text[ ]="AISSCE 2014";
encode(Text);
cout<<Text<<endl;
}
(f) In the following program, if the value of Guess entered by the user is 65, what
will be the expected output(s) from the following options (i), (ii), (iii) and (iv)?
2
#include <iostream.h>
#include <stdlib.h>
void main()
{
int Guess;
randomize();
cin>>Guess;
for (int I=4;I>=1;I--)
{
New=Guess+random(I);
cout<<(char)New;
}
}
(i) ACBA
(ii) BBCA
(iii) CDBA
(iv) DABA
(a) What do you understand by Data Abstraction? How is it implemented in C++?
2
(b) Answer the questions (i) and (ii) after going through the following class:
2
class Game
{
int Duration;
public:
Game()
//Function 1
{
Duration=70; cout<<"Count Down begins"<<endl;
}
Game (intT) //Function2
{
Duration=T; cout<<" Count Down begins "<<endl;
}
~Game()
//Function 3
{
cout<<"Declare Winners"<<endl;
}
};
i) In Object Oriented Programming, what is Function 3 referred as and when does it get
invoked/called?
ii) In Object Oriented Programming, which concept is illustrated by Function 1 and
Function 2 together? Write an example illustrating the calls for these functions.
(c)Define a class book in C++ with the following descriptions :
4
private members :

3
book_Id
title
author
price
quantity
discount
caldisc()

long
String
String
float
Integer
float
A function to calculate and return discount amount as per the
following criteria.
Price
>=500
300-499
0-299

Discount
10%
5%
No discount

public members:
enter_book()

A function to input the data members book_Id, title, author, price, and
quantity and to invoke caldisc() to assign value to discount.
show_book()
To display the book details.
(d) Answer the questions (i) to (iv) based on the following:
4
class CUSTOMER
{
intCustno;
charCustName[20];
protected:
void Register();
public:
CUSTOMER();
void Status();
};
class SALESMAN
{
intSalesmanno;
charSalesmanName[20];
protected:
float Salary;
public:
SALESMAN();
void Enter();
void Show();
};
classSHOP : public CUSTOMER , private SALESMAN
{
charVoucherNo[10];
charSalesDate[8];
public:
SHOP();
voidSalesEntry();
voidSalesDetail();
};
(i) Write the names of data members which are accessible from objects belonging to class
CUSTOMER.
(ii) Write the names of all the member functions which are accessible from objects belonging to
class SALESMAN.

3.

4.

(iii) Write the names of all the members which are accessible from member functions of class
SHOP.
(iv) How many bytes will be required by an object belonging to class SHOP?
(a) Write a function in C++ which accepts an integer array and its No. of elements as
arguments and exchanges the values of first half side elements with the
second half side elements of the array.
3
Example:
If an array of eight elements has initial content as
1,2,3,4,5,6,7,8
The function should rearrange the array as
5,6,7,8,1,2,3,4 [if the no. of elements is odd middle element will remain unchanged]
(b) An array A[25][15] is stored in the memory along the column with each of its
elements occupying 4 bytes. Find out the base address and the address of an
element A[12][7], if the location A[10][10] is stored at the address 8000.
3
(c) Define the functions push() and pop() of the following class for implementing a dynamic
stack.
4
struct Node
{
intp,q;
Node *Link;
};
class Stack
{
Node *top;
public:
STACK() {top=NULL;}
void push();
void pop() ;
~Stack();
};
(d) Write a function in C++ to print the sum of all the values which are either divisible
by 3 or are divisible by 5 present in a two-dimensional array passed as argument
to the function.
2
(e) Evaluate the following postfix notation of expression:
2
10 20 + 25 15 - * 30 /
(a) Observe the program segment given below carefully and fill in the missing statements.
1
class Team
{ longTid;
charTName[20];
float Points;
public:
void accept();
void show();
voidPointchange();
longR_Tid(){return Tid;}};
voidReplacePoints( long Id)
{ fstream File;
File. Open(Team.DAT, ios::binary||ios::in||ios::out);
Team T;
int Record =0, found=0;
while(!found &&File.read((char*)&T, sizeof(Team)))
{ if(Id==T.R_Tid())
{
cout<<Enter new Points;
T.Pointchange();

5
--------------------- // statement 1 to position file pointer
--------------------- // statement 2 to write the object into the file.
found=1;
}
Record++;
}
if (found ==1)cout<<Record Updated;
File.close();
}

5.

(b) Write a program in C++ tocount the total occurrences of words he and she in a
text file story.txt. [Caseof the words to be ignored]
2
(c) Consider the following class declaration:
class Customer
{
charname[20];
charaddress[30];
char city[15];
charphoneno[15];
public:
void ledger();
voiddisp();
intcheckcity(char A[])
{
returnstrcmp(city, A);
}
};
Write a function COPYCITY() in C++ to search and copy only those records that have
city as Delhi from a binary file CUSTOMER.DAT to DELHIDATA.DAT.
(a) What do you understand by Candidate Keys in a table ? Give a suitable example.
(b) Consider the following tables SHOP and SUPPLIER and answer the following questions:

TABLE : SHOP
ICODE
1005
1003
1002
1006
1001
1004
1009

INAME
Note Book
Eraser
Pencil
Bag
Pen
Sharpener
Box

SCODE
13
12
12
11
13
12
11

QTY
120
80
300
70
250
100
50

RATE
24
5
10
300
20
10
80

BUYDATE
03-May-13
07-Aug-13
04-Mar-13
27-Dec-12
18-Jul-13
23-Jun-13
17-Dec-12

TABLE : SUPPLIER
SCODE SNAME
11
Arya Stationers
12
Stationery House
13
Sapna Stores
(b1) Write SQL commands for the following statements :
(i) To display details of all the items in the shop table in ascending order of
Buydate.
(ii)To display ICODE and INAME of the items with QTY more than 100.
(iii) To diplay the ICODE, INAME and TOTAL AMOUNT of each item ( TOTAL AMOUNT is the
product of QTY and RATE.
(iv) To display SCODE and Number of items supplied for each Supplier

6.

(b2) Give the output of the following SQL queries:


(i) SELECT COUNT (DISTINCT SCODE) FROM Shop;
(ii) SELECT SUM(QTY) FROM Shop where SCODE=11;
(iii)SELECT INAME, SNAME FROM Shop S, Supplier P WHERE S.Scode =
P.Scode AND ICODE = 1006 ;
(iv) SELECT MIN (BUYDATE) FROM Store ;
(a) State and verify Associative law in Boolean Algebra.
(b) Write the equivalent Boolean expression for the following Logic Circuit :

(c) Write thePOS form of a Boolean Function F, which is represented by the following
truth table:
A
0
0
0
0
1
1
1
1

B
0
0
1
1
0
0
1
1

C
0
1
0
1
0
1
0
1

2
2

F
1
0
0
1
0
0
1
1

(d) Reduce the following Boolean expression using K - Map:


F (A, B, C, D) = (0, 1, 2, 3, 4, 5, 10, 11, 15)

(a) What is packet switching?


(b) Name two client side scripting languages?
(c) What is SMTP?
(d) What is Trojan Horse?
(e) SOFTSTREAMS INFOTECH has decided to network its office spread in four blocks

1
1
1
1

NILA

PAMBA

PERIYAR

KABANI

No. of Computers in each block

7
Block
PERIYAR
NILA
PAMBA
KABANI

No of Computers
70
40
100
50

Distance between various blocks


PERIYAR
NILA
80 M
PAMBA
PERIYAR
120 M
NILA
PAMBA
40 M
PAMBA
KABANI
30 M
KABANI
NILA
110 M
KABANI
PERIYAR
150 M
(e1) Suggest the most suitable place for the company to place the server.
(e2) Suggest the most suitable cable layout for connecting various blocks.
(e3) Suggest the placement of Switch/Repeater in the network.
(e4) The organization is planning to link its front office situated in the city in a hilly region
where cable connection is not feasible, suggest an economic way to connect it with
reasonablyhigh speed?
(f) How is a freeware different from a free software?
(g) What is cloud computing?
******************************

1
1
1
1

1
1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy