Computer Practical
Computer Practical
Duration: 3 hours
1. Programming in C++ 10 Marks
Total Marks: 30
One programming problem in C++ to be developed and tested in Computer during the examination. Marks are allotted on the basis of following: Logic : ....5 Marks Documentation/ Indentation : 2 Marks Output presentation :...3 Marks Notes: The types of problems to be given will be of application type from the following topics Arrays (One dimensional and two dimensional) Array of structure Stack using arrays and linked implementation Queue using arrays (circular) and linked implementation Binary File operations (Creation, Displaying, Searching and modification) Text File operations (Creation, Displaying and modification) 2. SQL Commands 05 Marks Five Query questions based on a particular Table/Reaction to be tested practically on Computer during the examination. The command along with the result must be written in the answer sheet. 3. Practical File.05 Marks Must have minimum 50 programs from the following topics:Arrays (One dimensional and two dimensional, sorting, searching, merging, deletion& insertion of elements) Arrays of structures, Arrays of Objects Stacks using arrays and linked implementation Queues using arrays (linear and circular) and linked implementation File (Binary and Text) operations (Creation, Updation, Query) Any computational based problems 15 SQL commands along with the output based on any table/relation: .....3 Marks 4. Project file ...05 Marks 5.Viva Voce ..05 Marks Viva will be asked from syllabus covered in class XII .
SOURCE MUMBAI
DEST
NO_OF_FL NO_OF_STOP 2 3 0 4 0 3
BANGALORE 3 8 6 1 4 3
BANGALORE KOLKATA DELHI MUMBAI LUCKNOW DELHI VARANASI KOCHI DELHI CHENNAI
a) Display flight number & number of flights from Mumbai from the table flights. b) Arrange the contents of the table flights in the descending order of destination. c) Increase the tax by 2% for the flights starting from Delhi. d) Display the flight number and fare to be paid for the flights from Mumbai to Kochi using the tables, Flights & Fares, where the fare to be paid =fare+fare*tax/100.
Q2. Get roll no and marks of the students and stored into a file.
(5)
Q3. Write a complete program in C++ to implement a dynamic allocated stack containing names of countries. (5)
Table : Salary
Eid 1 2 3 4 5 6 Basic 6000 2000 1000 1500 8000 10000 DA 2000 300 300 390 900 300 HRA 2300 300 300 490 900 490 Bonus 200 30 40 30 80 89
a. To display the frequency of employees department wise. b. To list the names of those employees only whose name starts with H c. To add a new column in salary table . the column name is total_sal. d. To store the corresponding values in the total_sal column.
Q2:- Write program to read all the records present in an already exiting binary file SPEED.DAT and display them on the screen, also count the number of records present in the file. (5) Q3.Write a complete program in C++ to implement a dynamically allocated Queue containing names of cities. (5)
BOARD PRACTICAL EXAMINATION 2013-2014 CLASS XII COMPUTER -CODE NO (083) EVALUATION SCHEME
Board R.NO. 9117960 9117964 9117967 ABHISHEK JHA AKHIL BHANDARI DIVYA SINGH MEENAKSHI VERMA 9117982 9117983 9117984 9117985 9117988 9117996 9118000 NIVESH KR. SINGH PANKAJ GUSAIN POOJA JHA POONAM KUMARI RICHA KASHYAP VIKAS KUMAR PANKAJ KUMAR A B A B A B A Name
Q. Paper Set
A B A B
Practical File
(5)
Project (5)
Viva Voce( 5)
9117977
_________________
Signature of Internal Examiner Examiner
__________________
Signature of External
SELECT *
UPDATE FARES
4 4210
2 SELECT NAME
ADD(TOTAL_SAL,LONG);
4 UPDATE SALARY
SET TOTAL_SAL=BASIC+DA+HRA;
5 RAJAT TYAGI
HARI MOHAN HARRY JYOTI
6 10000 7F
2
M 4
SET A Q:2
#include<iostream.h> #include<fstream.h> void main() { ofstream fileout; fileout.open("marks.dat",ios::out); char ans='y'; int rollno; float marks; while(ans=='y'||ans=='Y') { cout<<"\n Enter roll no.";
cin>>rollno; cout<<"\n Enter marks"; cin>>marks; fileout<<rollno<<'\n'<<marks<<'\n'; cout<<"\n Want to enter more records?(y/n)...."; cin>>ans; } fileout.close(); }
Set B Q:2
*Write a function showfile() to read all the records present in an already exiting binary file SPEED.DAT and display them on the screen ,also count the number of records present in the file.*/
Void showfile() { ifstream fin; fin.open(SPEED.DAT,ios::in|ios::binary); vehicle v1; int count=0; while (!fin.eof()) { fin.read((char *)&v1,sizeof(v1)); count++; v1.showdetails(); } cout<<Total number of records are <<count; }
SET A Q:3
#include<iostream.h> #include<conio.h> #include<stdio.h> #include<stdlib.h> struct node { char city[20]; node*link; }; class queue { node*rear,*front; public: queue() { rear=NULL; front=NULL; } void push(); void pop(); void display(); ~queue(); }; void queue::push() { node*temp=new node; gets(temp->city); temp->link=NULL; if(rear==NULL) { rear=front=temp; }
else { rear-> link=temp; rear=temp; } } void queue::pop() { if(front == NULL)cout<<"UNDERFLOW!!!"; else { node*ptr=front;
cout<<front -> city<<"deleted/n"; front=front->link; delete ptr; if( front == NULL) rear =NULL; } } void queue ::display() { node*temp=front; while(temp != NULL) { cout<<temp->city<<"->"; temp=temp->link; } cout<<"!!!\n"; } queue::~queue() { node*temp;
while(front!=NULL) { temp=front->link; delete temp; } } void main() { queue qt; int ch; while(1) { cout<<"Menu:\n 1)push\n2)pop\n3) display\n4)Exit\n"; cout<<"enter your choice:"; cin>>ch; switch(ch) { case1: qt.push(); break; case2: qt.pop(); break; case3: qt.display(); break; case4: exit(0); default: cout<<"wrong choice entered"; } } }
SET B Q:3
#include<iostream.h> #include<conio.h> #include<stdio.h> #include<stdlib.h>
struct node { char city[20]; node*link; }; class queue { node*rear,*front; public: queue() { rear=NULL; front=NULL; } void push(); void pop(); void display(); ~queue(); }; void queue::push() { node*temp=new node; gets(temp->city); temp->link=NULL; if(rear==NULL) { rear=front=temp; } else { rear-> link=temp; rear=temp; } }
cout<<front -> city<<"deleted/n"; front=front->link; delete ptr; if( front == NULL) rear =NULL; } } void queue ::display() { node*temp=front; while(temp != NULL) { cout<<temp->city<<"->"; temp=temp->link; } cout<<"!!!\n"; } queue::~queue() { node*temp; while(front!=NULL) { temp=front->link; delete temp; } }
void main() { queue qt; int ch; while(1) { cout<<"Menu:\n 1)push\n2)pop\n3) display\n4)Exit\n"; cout<<"enter your choice:"; cin>>ch; switch(ch) { case1: qt.push(); break; case2: qt.pop(); break; case3: qt.display(); break; case4: exit(0); default: cout<<"wrong choice entered"; } } }