Sie sind auf Seite 1von 44

Bonafide certificate

Certified to be the Bonafide record of work done by


_____________ of Std XII, Kola Saraswathi Vaishnav Senior
Secondary School, 41, Barnaby Road, Kilpauk, Chennai-
600010 during the academic year 2009-10.

Date: Subject Teacher

Submitted for All India Senior Secondary Practical


Examination held in COMPUTER SCIENCE at Kola
Saraswathi Vaishnav Senior School, Kilpauk, Chennai-
10.

Date: External Examiner

School Seal
ACKNOWLEDGEMENT
We would like to express our deep gratitude
to Mrs. B.Sumathi, Our computer science teacher for
helping and guiding us in completing this project
successfully.

We will be failing in our duty, if we don’t thank Our


Principal Mr. S .Athmanathan for his everlasting support
and encouragement in all our action and deeds which has
helped us a long way in finishing this project.

We attribute the success of our project to the combined


effort of the people mentioned above.
PROJECT DONE :

CLASS :

SUBJECT : Computer Science

PROJECT NAME :

SIGN.OF THE TEACHER


INCHARGE :

SIGN.OF THE EXTERNAL


EXAMINER :

SCHOOL SEAL :
The project “question paper” prepares question paper covering the
following lessons

1. Structure
2. Class & Object
3. Constructor & Destructor
4. Function Overloading
5. Inheritance
6. Implementation of data structure
7. Boolean Algebra
8. Files Organization

The program has been stored in the project in the file ‘project’ &
four disk files are used in the program are

1. On1.dat
2. To2.dat
3. Thee3.dat
4. Fiv5.dat

To compile and run the program

1. First go to the directory


2. type TC file
3. Open the file crefile.cpp, press ctrlF9 to compile & run.
4. Open Second file try.cpp, press ctrlF9 to compile & run.
5. Questions are displayed according to the pattern of question
paper.
SYSTEM ANALYSIS

TOOLS LANGUAGE AND PLATFORM TO BE USED

 HARDWARE SPECIFICATION

• Memory: 984 KB
• Microprocessor:1.2
• Hard disk:40 GB
• Printer: hp Laser printer

 SOFTWARE SPECIFICATION

• Platform : C++ with graphics


• Front End: C++
• Windows XP
• M.S Word
Files required
1.Crefile :
Fields
• int no
• char ques

2. Try file:
Fields
• Int no
• Char ques

Class required:
Question

Data and Function Member:


Int no;
Char ques (100)
Void getdata ();
Void display();
Project
Outline
Menu
1. Creation of files
2. Question selection
3. Display of try files
Creation of crefile:
The file storing the question is created is created . The
disk files on1.dat, to2.dat, Thee34.dat & fiv5.dat are
assigned to the file variable . The function getdata () is
used to read the content of files .

Operation:
1. Void one() :
One mark questions are stored.

2. Void two () :
Two mark question are stored.
3. Void three () :
Three mark question are stored.

4. Void four () :
Six mark question are stored.
Question selection :
1. From the disk file ’on1.dat’ required
number of mark question are selected.
2. From the disk file ‘to2.dat’ required
number of two marks question are
selected.
3. From the disk file ‘thee3.dat’ required
number of three marks question are
selected .
4. From the disk file ‘fiv5.dat’ required
number of five marks question are
selected.
The disk file1.dat is assigned to file variable

Display of try file:


The question papers containing the
randomly selection question are displayed.
Main menu
a) Crefile
b) Tryfile

Step1: While a then:


Crefile

Step 2: Menu display:


1. Creation
2. Display

Step 3: Enter the choice

Step 4: If choice =1 then

Step 5:
Creation
a) Option is selection for one mark
Read the number of question to be created for one mark

for (i=1 to 20)


Access getdata() function
Write to the object into file

b) Display the information from the file


Access the display ()
Read the object from file

Step 6:
Repeat step 5 for two marks, three marks & six marks
Exit
Step 7:
While ob
Try file

Step 8:
Creation & display of try file

Step 9:
Open “on1.dat” file 1 one mark
Set r=rand () %21
If (r=0) repeat step 9
Else set a [0]=r, for (I=1 to 5)

Step 10:
Set r=rand (_) %21
If (r=0) repeat step 10
Else if (a[i]=r)repeat step 10
Else set j=j+1

Step 11:
Set a [i]=r, for (I=0 to 5)
If (a[i]>a[j])
Set temp=a[i]
a[i]=a[j]
a[j]=temp, set i=0
read file1();

Step 12:
If(a[i]=bank.n)
Set strcpy(paper(==L1),bank.ques)
Set i=i+1

Step 13:
For(i=0 to 11)
Print ++q1
Print paper(i),100:

Step 14:
Close File

Step 15:
Repeat step 9th and 13th for two marks, three marks and five
marks.

Step 16:
Compile and run the program.
For output.

Step 17:
Exit.
Start

Input option
Enter the option
1.Creation and display
2.Selection and display

If Option = Stop
=0

If Option
==1 S

Input number
of Case
Case
question
Case
Mark
and3:
4:
1:marks
2:
three
four
=0
one
two 0
00 2CD
A
B
Yes

Input marks 2

X A

Open a file
File.open(“one.d
ata”)

For(i=0
; i=20;
i++)
For(i=0
; i=20;
i++)

Write q getdata
file.write
Write q getdata
file.write
While(file
file.read
Write
Read q.getdata
) q.display
X K
file.read
file.write
file.close
file.read
X

Open a file
File.open(to2.dat)

For(i
=1;i<
20;i+
+)

Input q .getdata ()
File .write ()

File. read ()

Whil
e
(file)

Read q.display
file. read

File. Close ()

X
X

Open a file
File.open(“three3.dat”)

For(i=
1;i=20;
i++)

Write q. getdata
File . write

File.read

While
(file)

Read q. display
File.read

File.close

X
A

Open a file
File.open(“five.da
t”)

For i=1; i<20; i+


+)

Write g.getdata
file.write()

File.read()

While
(file)

Read q.display
file.read K

X
X

Input option
select and
display

One mark question


is selected and
stored in an array

Two mark
question is
selected and
stored in an array

Three mark question


is selected and stored
in an array

Five mark question is


selected and stored in
an array

X
X

Print the selected one


mark question

Print the selection two


mark question

Print the selection three


mark question

Print the selection four


mark question

Stop
#include<iostream.h>
#include<stdio.h>
#include<fstream.h>
#include<string.h>

class question
{
public:
int no;
char ques[100];
void getdata();
void display();
};

void question::getdata()
{
cout<<"\n\t Enter the Question no. "<<endl;
cin>>no;
cout<<"\n\t Enter the question"<<endl;
gets(ques);
}

void question::display()
{
cout<<"\n\t Question "<<no<<" "<<ques<<endl;
}
question q;
void one();
void two();
void three();
void five();
void main()
{
int mark;
while(mark!=0)
{
switch(mark)
{
case 1:
{
one();
}

case 2:
{
two();
}

case 3:
{
three();
}

case 4:
{
five();
}
break;
}//end of switch
cout<<"\n\t Enter the 1:one mark, 2:two mark, 3:three mark,
4:five mark"<<endl;
cin>>mark;
}//end of while
}//end of main

void one()
{
fstream file;
file.open("on1.dat",ios::app|ios::in|ios::out|ios::binary);
for(int i=1;i<2;i++)
{
q.getdata();
file.write((char* )&q,sizeof(q));
}
file.seekg(0,ios::beg);
file.read((char *)&q,sizeof(q));
while(file)
{
q.display();
file.read((char *)& q,sizeof(q));
cout<<"\n\t Enter a key to continue"<<endl;
char ch;
cin>>ch;
}
file.close();
return;
}

void two()
{
fstream file;
file.open("to2.dat",ios::app|ios::in|ios::out|ios::binary);
for(int i=1;i<2;i++)
{
q.getdata();
file.write((char*)&q,sizeof(q));
}
file.seekg(0,ios::beg);
file.read((char *)&q,sizeof(q));
while(file)
{
q.display();
file.read((char *)& q,sizeof(q));
cout<<"\n\t Enter a key to continue"<<endl;
char ch;
cin>>ch;
file.read((char *)& q,sizeof(q));
}
file.close();
return;
}

void three()
{
fstream file;
file.open("three3.dat",ios::app|ios::in|ios::out|ios::binary);
for(int i=1;i<2;i++)
{
q.getdata();
file.write((char *)&q,sizeof(q));
}
file.seekg(0,ios::beg);
file.read((char *)&q,sizeof(q));
while(file)
{
q.display();
char ch;
cout<<"\n\t Press a key to continue"<<endl;
cin>>ch;
file.read((char*)& q,sizeof(q));
}
file.close();
return;
}

void five()
{
fstream file;
file.open("five5.dat",ios::app|ios::in|ios::out|ios::binary);
for(int i=1;i<2;i++)
{
q.getdata();
file.write((char *)&q,sizeof(q));
}
file.seekg(0,ios::beg);
file.read((char *)&q,sizeof(q));
while(file)
{
q.display();
char ch;
cout<<"\n\t Press a key to continue"<<endl;
cin>>ch;
file.read((char *)& q,sizeof(q));
}
file.close();
return;
}
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<fstream.h>
#include<stdlib.h>
#include<stdio.h>

class question
{
public:
int n;
char ques[100];
void inputdata();
void display();
};

void question::inputdata()
{
cin>>n;
cin>>ques;
}

void question::display()
{
puts(ques);
}
int t1=-1,t2=-1,t3=-1;
question bank;
char paper[10][100],paper2[5][100],paper3[5]
[100],paper4[5][100];
void heading();
void one();
void two();
void three();
void five();
question ar1[10],ar2[10],ar3[10];

fstream file1,file2;
int on;
int l1=-1,l2=-1,l3=-1,l4=-1;

void main()
{
heading();
one();
two();
three();
five();
}

void heading()
{
clrscr();
cout<<"\n\t KOLA SARASWATHI VAISHNAV
SENIOR SECONDARY SCHOOL "<<endl;
cout<<"\n\t IV MONTHLY TEST
"<<endl;
cout<<"\n\t XII STD 35
MARKS "<<endl;
cout<<"\n\t 7/1/11 1 1/2
Hour "<<endl;
}

void one()
{
cout<<"\n\t ANSWER THE FOLLOWING ONE MARK
QUESTIONS (1*4=4) "<<endl;
cout<<"\n\t
"<<endl;
int a[10];
file1.open("on1.dat",ios::app|ios::in|ios::out|ios::binary);
file1.seekg(0);
int r;
one1:r=rand()%21;
if(r==0)
goto one1;
else
a[0]=r;

for(int i=1;i<=5;i++)
{
start:r=rand()%21;
if(r==0)
goto start;
int j=0;
while(j<i)
{
if(a[j]==r)
goto start;
else
j=j+1;
}//end of while
a[i]=r;
}//end of for
for(i=0;i<5;i++)
{
for(int j=i+1;j<5;j++)
{
if(a[i]>a[j]);
{
int temp=a[i];
a[i]=a[j];
a[j]=temp;
}//end of if
}//end of j loop
}//end of i loop

i=0;
file1.seekg(0);
file1.read((char *)&bank,sizeof(bank));
while(file1)
{
if(a[i]==bank.n)
{
strcpy(paper[++l1],bank.ques);
i+=1;
}//End of if
file1.read((char *)& bank, sizeof(bank));
}//end of while
int q1=0;
for(i=1;i<=4;i++)
{
cout<<"\n\t "<<++q1<<" ";
cout.write(paper[i],100)<<endl;
}//enf of for
char ch;
cout<<"\n\t Enter any key to continue";
cin>>ch;
clrscr();
file1.close();
return;
}

void two()
{
cout<<"\n\t ANSWER THE FOLLOWING TWO MARK
QUESTIONS (2*5=10) "<<endl;
cout<<"\n\t
"<<endl;
int b[10];
file1.open("to2.dat",ios::app|ios::in|ios::out|ios::binary);
file1.seekg(0);
int r;
one1:r=rand()%21;
if(r==0)
goto one1;
else
b[0]=r;

for(int i=1;i<=5;i++)
{
start:r=rand()%21;
if(r==0)
goto start;
int j=0;
while(j<i)
{
if(b[j]==r)
goto start;
else
j=j+1;
}//end of while
b[i]=r;
}//end of for
for(i=0;i<4;i++)
{
for(int j=i+1;j<5;j++)
{
if(b[i]>b[j]);
{
int temp=b[i];
b[i]=b[j];
b[j]=temp;
}//end of if
}//end of j loop
}//end of i loop

i=0;
file1.seekg(0);
file1.read((char *)&bank,sizeof(bank));
while(file1)
{
if(b[i]==bank.n)
{
strcpy(paper2[++l2],bank.ques);
i+=1;
}
file1.read((char *)& bank, sizeof(bank));
}
int q2=0;
for(i=1;i<=5;i++)
{
cout<<"\n\t "<<++q2<<" ";
cout.write(paper2[i],100)<<endl;
}
file1.close();
char ch;
cout<<"\n\t Enter any key to continue";
cin>>ch;
clrscr();
return;
}
void three()
{
cout<<"\n\t ANSWER THE FOLLOWING THREE MARK
QUESTIONS (3*5=15) "<<endl;
cout<<"\n\t
"<<endl;
int c[10];
file1.open("three3.dat",ios::app|ios::in|ios::out|ios::binary);
file1.seekg(0);
int r;
one1:r=rand()%21;
if(r==0)
goto one1;
else
c[0]=r;

for(int i=1;i<=5;i++)
{
start:r=rand()%21;
if(r==0)
goto start;
int j=0;
while(j<i)
{
if(c[j]==r)
goto start;
else
j=j+1;
}//end of while
c[i]=r;
}//end of for
for(i=0;i<4;i++)
{
for(int j=i+1;j<5;j++)
{
if(c[i]>c[j]);
{
int temp=c[i];
c[i]=c[j];
c[j]=temp;
}//end of if
}//end of j loop
}//end of i loop

i=0;
file1.seekg(0);
file1.read((char *)&bank,sizeof(bank));
while(file1)
{
if(c[i]==bank.n)
{
strcpy(paper3[++l3],bank.ques);
i+=1;
}
file1.read((char *)& bank, sizeof(bank));
}
int q3=0;
for(i=1;i<=5;i++)
{
cout<<"\n\t "<<++q3<<" ";
cout.write(paper3[i],100)<<endl;
}
file1.close();
char ch;
cout<<"\n\t Enter any key to continue";
cin>>ch;
clrscr();
return;
}
void five()
{
cout<<"\n\t ANSWER THE FOLLOWING SIX MARK
QUESTIONS (6*1=6) "<<endl;
cout<<"\n\t
"<<endl;
int d[10];
file1.open("fiv5.dat",ios::app|ios::in|ios::out|ios::binary);
file1.seekg(0);
int r;
one1:r=rand()%21;
if(r==0)
goto one1;
else
d[0]=r;

for(int i=1;i<=1;i++)
{
start:r=rand()%21;
if(r==0)
goto start;
int j=0;
while(j<i)
{
if(d[j]==r)
goto start;
else
j=j+1;
}//end of while
d[i]=r;
}//end of for
for(i=0;i<1;i++)
{
for(int j=i+1;j<1;j++)
{
if(d[i]>d[j]);
{
int temp=d[i];
d[i]=d[j];
d[j]=temp;
}//end of if
}//end of j loop
}//end of i loop

i=0;
file1.seekg(0);
file1.read((char *)&bank,sizeof(bank));
while(file1)
{
if(d[i]==bank.n)
{
strcpy(paper4[++l4],bank.ques);
i+=1;
}
file1.read((char *)& bank, sizeof(bank));
}
int q4=0;
for(i=1;i<=1;i++)
{
cout<<"\n\t "<<++q4<<" ";
cout.write(paper4[i],100)<<endl;
}
file1.close();
char ch;
cout<<"\n\t Enter any key to continue";
cin>>ch;
clrscr();
return;
}

KOLA SARASWATHI VAISHNAV SENIOR SECONDARY SCHOOL

I UNIT TEST

X11 STD 35 MARKS

7.1.2011 1 ½ HOUR

ANSWER THE FOLLOWING ONE MARK QUESTIONS (1*4=4)


1.Name the header files that shall be needed for the following code:
void main()
{
char sring[]=”peace”;
count<<setw(20)<<string;
}
2.Define Structure.
3.Define Multiple Inheritence.
4.What does inheritance mean.

ANSWER THE FOLLOWING TWO MARK QUESTION (2*5=10)


1.Differentiate between get and getline member functions of istream class.
2.Define the following:
(a) Minterm (b)Maxterm
3.State the Associative Law and Distributive law.
4.How is TELNET service of internet useful.
5.Give the full form for the following:
(a)Modem (b)NFS (c)FTP (d)GSM

ANSWER THE FOLLOWING THREE MARKS QUESTION (3*5=15)


1.Differentiate between Static and Dynamic allocation of memory.
2.What are the facilities provided by the SERVER in a network environment.
3.Differentiant between DML and DDL with example.
4.How are binary files different from text file in C++?
5.Differentiate between:
(a)Hackers and Crackers
(b)GSM and CDMA

ANSWER THE FOLLOWING SIX MARKS QUESTION (1*6=6)


1.(a) State De Morgan’s Laws and verify it using truth table. 2
(b) Write the Dual of the Boolean Expression (B’+C).A 1
(c) What is the purpose of using repeater in context of networking. 1
(d) Write one advantage and one disadvantage of the following topologies: 2
(i) BUS topologies (ii) STAR topologies
 Computer Science with C++ by Sumitra Arora

 Object Oriented Programming in C++ by Robert Lafore

Das könnte Ihnen auch gefallen