0% found this document useful (0 votes)
6 views4 pages

XII - Comp - SC Practical

Uploaded by

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

XII - Comp - SC Practical

Uploaded by

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

AISSCE (2016 – 17)

QUESTIONS IN COMPUTER SCIENCE (083) PRACTICAL EXAM


Time : 3 hrs. Class- XII F.M – 30
1. Programming in C++ 10

A. Write a user-defined function


DispTen(int A[], int N)
in C++ to find and display all the numbers, which are not divisible by 10. Also write the main
function to execute the program .
Example, if the content of array is 2, 10 , 30,33 then the output will be 2,3.

B. Write a program to print those elements of a matrix of order 3X3 that are not diagonal
elements after input from the user .

C. Write a program to input the elements of 3X3 array & display the sum of elements of the
alternate position as given below i.e 6 + 77 + 44 +99 .

OUTPUT :
sum of alternate elements = 226
3 6 9
77 66 44
88 99 100

D. Write a program to input the elements in the Array A [3][3] and Array B [3][3]. Store each
element of both array in a third array C [3][3] after addition . Display the third array C in
matrix form .

E. Write a program to input the elements in the array A [10] and B[10]. Store the elements
rowwise of array A in ascending order and in descending order in B and merge in the
third array C[20] in ascending order .Display the third array

F. Define a class travel in c++ with following specifications :-


Private members :
tcode(string), noofadult(int), noofchildren(int) , distance(int), totalfarefloat)
assignfare( ) – calculate and assign the totalfare as given below :-
For each adult
fare distance
500 >1000
300 Between 500 – 1000
200 <500
For each children ,fare will be reduced by 50 % of the given fare
Public members :
A constructor to assign initial values as follows :-
Tcode with NULL ,noofadults as 0 , noofchildren as 0,distance as 0,totalfare as 0
entertravel ( ) – enter the values for tcode,noofadult,noofchildren and distance
and invoke the function assignfare ( )
showtravel ( ) – view the content of all the data members

Also write the main( ) , declaring an object of travel and executing it


G. Write a program to accept the elements in an array of maximum size 50 . Ask the user
how many elements to input and subsequently input the elements in the array . Now
input an element and fit that element in the appropriate position . Continue this process
as long as the user wants and finally display the array .Take the function mentioned
below :-

1st parameter is the array


int findpos(int [ ],int,int)-
2nd parameter is the size
3rd parameter is the item to be inserted
H. Write a program to accept the elements in an array of maximum size 50 . Ask the user
how many elements to input and subsequently input the elements in the array . Now
input an element to be searched in the array . If found , then display its index and
position otherwise display an error message “sorry ! given element could not be found”.
The function mentioned below is to be taken for the above process.

int lsearch(int [ ],int,int);


1st parameter is the array
2nd parameter is the size
3rd parameter is the item to be searched

I. Write a program to accept the elements in an array of maximum size 50 . Ask the user
how many elements to input and subsequently input the elements in the array in sorted
order . Now input an element to be searched in the array . If found , then display its
index and position otherwise display an error message “sorry ! given element could not
be found”. The function mentioned below is to be taken for the above process.

int bsearch(int [ ],int,int);


1st parameter is the array
2nd parameter is the size
3rd parameter is the item to be searched
J. Write a program to accept the elements in an array of maximum size 50 . Ask the user
how many elements to input and subsequently input the elements in the array .Now sort
or arrange the elements of the array using selection sort . The function mentioned below
is to be taken for the above process.
void selsort(int [],int);
1st parameter is the array
2nd parameter is the size
K. Write a program to accept the elements in an array of maximum size 50 . Ask the user
how many elements to input and subsequently input the elements in the array .Now sort
or arrange the elements of the array using bubble sort . The function mentioned below
is to be taken for the above process.
void bubblesort(int [],int);
1st parameter is the array
2nd parameter is the size
L. Write a program to accept the elements in an array of maximum size 50 . Ask the user
how many elements to input and subsequently input the elements in the array .Now sort
or arrange the elements of the array using insertion sort . The function mentioned below
is to be taken for the above process.
void inssort(int [],int);
1st parameter is the array
2nd parameter is the size
M. Write a program to declare a structure Node as given below and enter the information
i.e. a number to be stored in the beginning of the node which is created dynamically with
help of the following functions mention below. The above process will continue till the
user wants .
Given :
struct Node{ int info; Node *next; }*start,*newptr,*save,*ptr;
Node * create_New_Node(int); // to create a node
void insert_beg(Node*); // to insert in the beginning of a list
void display(Node*); // to display the information stored in the node

N. Write a program to enter the information i.e. a number to be stored in the queue using an array
and also display the elements in the queue with help of the following functions mention below.
Also remove an element from the queue . The above process will continue till the user wants.

Given :
int insert(int queue[ ],int ele); // this function will help you to insert the element in a stack
int remove(int queue[ ]);// remove the element from the queue
void display(int queue[ ],int front, int rear) ;// this function will display the contents of the stack

O. Write a program to declare a structure student with rollno , name , totalmark . Input the data for 3
students and store the data in a file student.dat .If the file exists , then the data will stored at the end
otherwise at the beginning of the file .Also display the contents of the file in the same program

2. STRUCTURED QUERY LANGUAGE [5 ]


Table : BOOKS
BOOKID BOOKNAME AUTHORNAME PUBLISHER PRICE TYPE QTY
S
C0001 fast cook Lata kapoor Epb 355 Cookery 5
F0001 the tears William Hopkins First publ 650 Fiction 20
T0001 my first c++ Brian & brooke Epb 350 Text 10
T0002 c++ brainworks a.w.rossaine Tdh 350 Text 15
F0002 thunderbolts Anna Roberts First publ 750 Fiction 50
Table : ISSUED

BOOKID QUANTITYISSUED
F0001 4
C0001 5
F0001 2
Write SQL statement for the queries :-

1) To show BOOKNAME , AUTHORNAME ,PRICE of BOOKS of First publ publishers


2) To list the TYPE and its count from BOOKS table
3) To display the BOOKNAME ,PRICE from BOOKS in ascending order of their price .
4) To display the BOOKNAME and QUANITYISSUED of all matching BOOKID
5) To display only the TYPE available in BOOKS table (wherever duplicates are there , single occurance is to
be taken)
Table : EMPLOYEE

ECODE NAME DESIG SGRADE DOJ DOB


101 Abdul ahmad Executive S03 23-mar-2003 13-jan-1980
102 Ravi chander Headit S02 12-feb-2010 22-jul-1987
103 John ken receptionist S03 24-jun-2009 24-feb-1983
105 Nazar amen Gm S02 11-aug-2006 03-mar-1984
108 Priyam sen Ceo S01 29-dec-2004 19-jan-1982
Table : SALGRADE

SGRADE SALARY HRA


S01 56000 18000
S02 32000 12000
S03 24000 8000
Write SQL statement for the queries :-
1) To display the details of all employees in descending order of doj
2) To display name and design of those employees whose salgrade is either s02 or s03
3) To display the content of all the employees table whose doj is in between ’09-feb-2008’ and ’08-aug-
2009’ .
4) List the sgrade and count of each from employee table
5) Display salary and salary + hra from salgrade table

Table: PRODUCT
PID PRODUCTNAME MANUFACTURER PRICE
TP01 Talcom powder LAK 40
FW05 Face wash ABC 45
BS01 Bath soap ABC 55
SH06 shampoo XYZ 120
FW12 Face wash XYZ 95
Table : CLIENT

CID CLIENTNAME CITY PID


01 Cosmetic shop Delhi FW05
06 Total health Mumbai BS01
12 Live life Delhi SH06
15 Pretty woman Delhi FW12
16 Dreams Bangalore TP01
Write SQL statement for the queries :-
1) To display the details of those clients whose city is Delhi
2) To display the details of products whose price is between 50 and 100 (both values included)
3) To display the clientname,city from table client, and productname and price from table product with their
corresponding matching PID
4) To display city and count of each from the table client
5) To display the details of client whose pid starts with F

3. Project Work
05
4. Practical File
06
5. Viva Voce 04

Signature (External Examiner) Signature (Internal Examiner)

You might also like