Professional Documents
Culture Documents
SCIENCE
ASSIGNME
NT
2k16-
2k17
PREPARED BY:
SANDEEP CHANDEL
CLASS:
XII A
BOARD NO. :
9192580
K.V A.A.I
RANGPURI
CERTIFICATE
This is to certify that SANDEEP CHANDEL, a
student of class XII-A has successfully
completed the research on the below
mentioned project under the guidance of Mrs.
Neeraj Yadav ( Subject Teacher ) during the
year 2016-17 in partial fulfillment of Comp.
Sci. practical examination conducted by
AISSCE, New Delhi.
Teachers signature
(MRS.NEERAJ YADAV)
ACKNOWLEDGEME
NT
In the accomplishment of this project
successfully, many people have best
owned upon me their blessings and the
heart pledged support, this time I am
utilizing to thank all the people who
have been concerned with project.
Primarily I would thank god for being
able to complete this project with
success. Then I would like to thank my
principal Mr. P.P Yadav and Comp Sci.
Teacher Mrs.Neeraj Yadav, whose
valuable guidance has been the ones
that helped me patch this project and
make it full proof success his
suggestions and his instructions has
served as the major contributor towards
the completion of the project. Then I
would like to thank my parents and
friends who have helped me with their
valuable suggestions and guidance has
been helpful in various phases of the
completion of the project. Last but not
the least I would like to thank my
classmates who have helped me a lot.
PROGRAMS
# Program using linked
stack to enter the name
of players
#include<iostream.h>
#include<conio.h>
#include<process.h>
#include<string.h>
struct Node
char info[30];
Node *next;
*top,*newptr,*save,*ptr;
Node *create_new_node();
void push(Node*);
void Display(Node*);
void main()
clrscr();
charch='y';
top=NULL;
clrscr();
while(ch=='y'||ch=='y')
newptr=create_new_node();
if(newptr==NULL)
{
cout<<"\n ERROR!!!Aborting";
exit(1);
push(newptr);
Display(top);
cin>>ch;
Node *create_new_node()
char a[30];
ptr=new Node;
cin>>a;
strcpy(ptr->info,a);
ptr->next=NULL;
returnptr;
if(top==NULL)
top=np;
else
save=top;
top=np;
np->next=save;
while(np!=NULL)
cout<<np->info<<"->";
np=np->next;
cout<<"!!!\n";
}
# Program using linked
queue to enter the name
of states.
#include<iostream.h>
#include<conio.h>
#include<process.h>
#include<string.h>
struct Node
{
char info[30];
Node *next;
*front,*newptr,*save,*ptr,*rear;
Node *create_new_node();
voidinsert_end(Node*);
void Display(Node*);
void main()
clrscr();
front=rear=NULL;
charinf[20];
charch='y';
clrscr();
while(ch=='y'||ch=='y')
cin>>inf;
newptr=create_new_node();
if(newptr==NULL)
cout<<"\n ERROR!!!Aborting";
exit(1);
insert_end(newptr);
Display(front);
cin>>ch;
Node *create_new_node()
char a[30];
cin>>a;
ptr=new Node;
strcpy(ptr->info,a);
ptr->next-NULL;
returnptr;
voidinsert_end(Node *np)
if(front==NULL)
front=rear=np;
else
rear->next=np;
rear=np;
while(np!=NULL)
cout<<np->info<<"->";
np=np->next;
cout<<"!!!\n";
}
# program to check whether
a number is angstrom
number or not
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
inta,b,c,num=0;
cin>>a;
c=a;
while(a!=0)
b=a%10;
a=a/10;
b=b*b*b;
num=num+b;
if(num==c)
else
getch();
}
# Program to
demonstrate
bubble sort
#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
void main()
{
clrscr();
constintarraysize=10;
int Bubble[arraysize];
for(inti=0;i<arraysize;i++)
cin>>Bubble[i];
for(int j=0;j<arraysize;j++)
cout<<setw(4)<<Bubble[j];
for(int y=0;y<arraysize;y++)
for(int k=0;k<<arraysize-1-y;k++)
if(Bubble[k]>Bubble[k+1])
int temp=Bubble[k+1];
Bubble[k+1]=Bubble[k];
Bubble[k]=temp;
for(int l=0;l<arraysize;l++)
cout<<setw(4)<<Bubble[l];
cout<<endl;
getch();
#include<conio.h>
#include<iomanip.h>
class number
{
private:
int a[10],b[10],mer[40];
public:
void readnum1();
void readnum2();
void merge();
voidprintnum();
};
void number::readnum1()
for(int j=0;j<10;j++)
cin>>a[j];
void number::readnum2()
for(int j=0;j<10;j++)
cin>>b[j];
void number::merge()
for(int j=0;j<10;j++)
mer[j]=a[j];
for(inti=0;i<10;i++,j++)
mer[j]=b[j];
void number::printnum()
for(int j=0;j<20;j++)
cout<<setw(4)<<mer[j];
void main(void)
clrscr();
numberobj;
obj.readnum1();
obj.readnum2();
obj.merge();
obj.printnum();
cout<<endl;
getch();
}
# Program of sum
of n terms
#include<iostream.h>
#include<conio.h>
#include<math.h>
inti,j;
for(i=1;i<=2*N;i+=2)
term=(sign*pow(x,i))/i;
sign*=-1;
sum+=term;
return sum;
void main()
clrscr();
floatx,result;
int N;
cin>>x;
cin>>N;
result=SUMFUN(x,N);
cout<<"\n result="<<result<<endl;
getch();
OUTPUT
# Program to check the
divisibility and check
whether prime or not
#include<iostream.h>
#include<conio.h>
int divide(inta,int b)
if(b==0)
return -1;
if((a%b)==0)
return 1;
else
return 0;
int divide(int a)
int j=a/2,flag=1;
for(inti=2;(i<=j)&&(flag);i++)
if(a%i==0)
flag=0;
return flag;
}void main()
clrscr();
intch,res,a,b;
do
cout<<"3.Exit \n";
cin>>ch;
cout<<"\n";
switch(ch)
case 1:
cin>>a>>b;
cout<<((res)?"Numenator is divisible by
denomenator":"Numenator is not divisible by
denominator")<<"\n\n\n\n\n\n" ;
break;
case 2:
cin>>a;
res=0;
res=divide(a);
break;
case 3:
break;
default:
}while(ch>0 &&ch<3);
getch();
}
# Program to display
information
About employees and
managers
#include<iostream.h>
#include<conio.h>
classticbooth
intno_people;
float amount;
public:
void initial();
voidnotsold();
void sold();
voiddisp_totals();
voiddisp_tickets();
};
voidticbooth::initial()
no_people=0;
amount=0.0;
voidticbooth::notsold()
no_people++;
voidticbooth::sold()
no_people++;
amount+=2.50;
voidticbooth::disp_totals()
{
cout<<no_people<<"people visited"<<endl;
voidticbooth::disp_tickets()
int ticket=int(amount/2.50);
cout<<ticket<<"ticket sold"<<endl;
void main()
clrscr();
ticbooth stall1;
stall1.initial();
intch;
do
cout<<"3. Exit"<<endl;
cin>>ch;
switch(ch)
{
case 1: stall1.notsold();
break;
case 2: stall1.sold();
break;
case 3: break;
};
}while(ch!=3);
stall1.disp_totals();
stall1.disp_tickets();
getch();
}
# Program to count no of
digits
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
void main()
clrscr();
ofstream f;
f.open("PARA.TXT");
chararr[100];
cin.getline(arr,100);
f<<arr;
f.close();
inti,count=0;
ifstream f1;
f1.open("PARA.TXT");
charch;
while(f1.eof()==0)
{
f1.get(ch);
i=ch;
cout<<ch;
if(((i>=48)&&(i>0))&&((i>0)&&(i<=57)))
count++;
getch();
}
BOOLEAN ALGEBRA
Q.1) An arrayArr[50][10] is stored in the memory along
the row with each element occupying 2 bytes. Find out
the address of the location Arr[20][50] if the location
Arr[10][25] is stored at the address 10000.
ANSWER:
Arr[50][10]
No. of Rows(R)=50
No. of Columns(C)=10
Arr[I][J]=Arr[20][50]
I=20,J=50
Lowest Column(Ic) =0
10000 = B + 250
B = 10000-2520 =
B = 9750
Parallely,
i.e.
a) Row wise
Given, Arr[5][5]
No. of Rows(R) = 5
No. of Column(C) =5
= 1000 + 4(10+4)
= 1000 + 56
= 1056
So,
b) Column wise:
Given,
Given, Arr[5][5]
No. of Rows(R) = 5
No. of Column(C) =5
= 1000 + 4(2+20)
= 1000 + 88
= 1088.
So,
9,Zaheer,36,Computer,12/03/97,230,M.
values(9,Zaheer,36,Computer,12/03/97,230,M)
e.
RELATION: issued
a. To show book name,authorname and price of books of
first publ,publishers.
UPDATE books
SET PRICE=PRICE+50
WHERE PUBLISHER=EPB;
values(F0003,1);
WHERE DISCOUNT>25;
Thank you.