KA

Document Sample
KA Powered By Docstoc
					#include<conio.h>
#include<iostream.h>
#include<stdio.h>
#include<dos.h>
#include<graphics.h>
#include<process.h>
void main()
{int l,q=0;
int a,y=0;
float b[25];
float n;
ka:
do{
clrscr();
textcolor(12);
gotoxy(30,2);
cprintf(" AIM\n");
textcolor(6);
gotoxy(2,3);
cprintf("To determine the strength of HCl in g/L titrating it against
standard NaOH");
gotoxy(2,4);
cprintf(" solution conductometrically. Also determine the value of cell");
gotoxy(2,5);
cprintf(" constant and conductivity ");
textcolor(1);
gotoxy(2,7);
cprintf("MENU\n\n");
textcolor(12);
gotoxy(3,9);
cprintf("1.APPARATUS AND CHEMICALS REQUIRED\n");
gotoxy(20,10);
textcolor(13);
cprintf("2.REACTIONS\n");
textcolor(14);
cprintf("3.OBSERVATIONS\n");
textcolor(3);
cprintf("4.CALCULATIONS\n");
textcolor(6);
cprintf("5.RESULT\n");
textcolor(9);
cprintf("6.DIAGRAM\n");
textcolor(8);
gotoxy(2,15);
cprintf("               Enter your choice : ");
cin>>a;
switch(a)
{

case 1: { clrscr();
textcolor(9);
gotoxy(4,11);
char o;
cprintf("If u have entered the wrong case and want to return\n");
gotoxy(4,12);
cprintf(" to main menu the press escape key or to continue press");
gotoxy(8,13);
cprintf("any other key: ") ;
o=getch();
if(o==27)
{ goto ka;
}
else
{clrscr();
textcolor(142);
gotoxy(25,2);
cprintf("1.APPARATUS AND CHEMICALS REQUIRED\n");
textcolor(10);
gotoxy(10,5);
cout<<char(20); cprintf(" Digital Conductivity Meter\n");
gotoxy(10,7);
cout<<char(20);cprintf(" Electrode\n");
gotoxy(10,9);
cout<<char(20);cprintf(" N/50 KCl Solution\n");
gotoxy(10,11);
cout<<char(20);cprintf(" N/10 NaOH \n");
gotoxy(10,13);
cout<<char(20);cprintf(" N/100 HCl\n");
getch();
}break;
}
case 2: {    clrscr();
textcolor(9);
gotoxy(4,11);
char o;
cprintf("If u have entered the wrong case and want to return\n");
gotoxy(4,12);
cprintf(" to main menu the press escape key or to continue press");
gotoxy(8,13);
cprintf("any other key: ") ;
o=getch();
if(o==27)
{ goto ka;
}
else
{clrscr();
textcolor(142);
gotoxy(30,2);
cprintf("2.REACTION AND DIAGRAM\n");
textcolor(10);
gotoxy(20,5);
cprintf("NaOH + HCl --> NaCl + water\n");
getch();
}break;
}
case 3: {     clrscr();
textcolor(9);
gotoxy(4,11);
char o;
cprintf("If u have entered the wrong case and want to return\n");
gotoxy(4,12);
cprintf(" to main menu the press escape key or to continue press");
gotoxy(8,13);
cprintf("any other key: ") ;
o=getch();
if(o==27)
{ goto ka;
}
else
{clrscr();
textcolor(142);
gotoxy(30,2);
cprintf("3.OBSERVATIONS\n");
textcolor(10);
gotoxy(2,3);
for(float i=0;i<=10;i=i+0.5)
{cout<<"enter the conductivity when "<<i<<" ml of NaOH was added\n";
cin>>b[y++]; }
}break;
}
case 4: {
clrscr();
textcolor(9);
gotoxy(4,11);
char o;
cprintf("If u have entered the wrong case and want to return\n");
gotoxy(4,12);
cprintf(" to main menu the press escape key or to continue press");
gotoxy(8,13);
cprintf("any other key: ") ;
o=getch();
if(o==27)
{ goto ka;
}
else
{clrscr();
textcolor(142);
gotoxy(30,2);
cprintf("4.CALCULATIONS\n");
textcolor(10);
y=0; float z,small;
small=b[0];
  for(float i=0;i<=10;i=i+0.5)
{ if(b[y]<small)
{
small=b[y];
z=i; }
y++;     }
gotoxy(2,4);
cprintf(" The volume of NaOH for which the conductivity was minimum is
%fml",z);
gotoxy(8,5);
cprintf("\n \n Enter the volume of HCl used in ml : ");
int m;
cin>>m;
gotoxy(25,7);
cprintf("\n\n Therefore :\n");
textcolor(15);
gotoxy(25,10);
cprintf(" N1 * V1(HCl) = N2 * V2(NaOH)\n");
textcolor(10);
gotoxy(25,11);
cprintf("N1=? \n");
gotoxy(25,12);
cprintf("V1 = %dml",m);
gotoxy(25,13);
cprintf("N2 = 0.1N \n");
gotoxy(25,14);
cprintf("V2 = %fml",z);
n=(0.1*z)/m;
gotoxy(25,16);
cprintf("noramlity of HCl N1 = %fN\n",n);
gotoxy(25,17);
cprintf("STRENGHT of HCl = %fg/L\n",n*36.5);
getch();}break;
}
case 5:{
clrscr();
textcolor(9);
gotoxy(4,11);
char o;
cprintf("If u have entered the wrong case and want to return\n");
gotoxy(4,12);
cprintf(" to main menu the press escape key or to continue press");
gotoxy(8,13);
cprintf("any other key: ") ;
o=getch();
if(o==27)
{ goto ka;
}
else
{     clrscr();
textcolor(142);
gotoxy(30,2);
cprintf("5.RESULT AND GRAPH\n");
textcolor(10);
gotoxy(2,1);
cprintf("STRENGHT of HCl = %fg/L\n",n*36.5);
gotoxy(2,2);
cout<<"S/cm     | "; cout<<endl;
cout<<"^   | "; cout<<endl;
cout<<"|   | "; cout<<endl;
cout<<"|   | ";cout<<endl;
cout<<"c   |\\ ";cout<<endl;
cout<<"o   | \\                           "; cout<<endl;
cout<<"n   | \\                           /\n";
cout<<"d   |   \\                        /\n";
cout<<"u   |    \\                      /\n";
cout<<"c   |     \\                    /\n";
cout<<"t   |      \\                  /\n";
cout<<"i   |        \\               /\n";
cout<<"v   |         \\             /\n";
cout<<"i   |          \\           /\n";
cout<<"t   |           \\         /\n";
cout<<"y   |            \\       /\n";
cout<<"    |             \\     /\n";
cout<<"    |              \\   /\n";
cout<<"    |               \\ /\n";
cout<<"    |                V\n";
cout<<"
     |________________________________________________________________
__\ X\n";
cout<<"    0                Volume of NaOH(ml)---->
\n";
getch();}break;
}
case 6: {
clrscr();
textcolor(9);
gotoxy(4,11);
char o;
cprintf("If u have entered the wrong case and want to return\n");
gotoxy(4,12);
cprintf(" to main menu the press escape key or to continue press");
gotoxy(8,13);
cprintf("any other key: ") ;
o=getch();
if(o==27)
{ goto ka;
}
else
{
int i=0,j,k,l=0,m=0,n=0,gd=DETECT,gm;

initgraph(&gd,&gm,"c:\\tc\\bgi");

cleardevice();

line(250,100,250,250);
line(260,100,260,250);

line(250,250,255,260);

line(260,250,255,260);

arc(255,110,180,360,5);

line(260,110,320,110);

line(320,100,320,350);

line(310,350,330,350);




line(245,310,245,350);

line(265,310,265,350);

while(i<=100)

       {line(250,150+i,260,150+i);

       i++;

       }

line(245,310,245,350);

line(265,310,265,350);

i=0;

while(i<=30)

       {delay(120);

       setcolor(0);

       line(251,150+i,259,150+i);

       setcolor(14);

       line(245,350-i,265,350-i);

       i++;

       }

i=0;
setcolor(5);

while(i<=30)

      {line(245,350-i,265,350-i);

     i++;

      }

getch();
}
break;
}
}
clrscr();
textcolor(133);
gotoxy(14,12);
cprintf("Do want to continue. If yes then enter 1 : ");
cin>>l;
}while (l==1);
}

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:9
posted:6/23/2012
language:
pages:7