You are on page 1of 20

Housing society project

By 12th student
Cerfiticate
This is to certify that Deepanshu Rathore of class
12th A has successfully completed the investigation work on
physics for Class Xll practical examination of the central board of
secondary
Education in the year 2017-2018 It is futher certified that this
Project is the group work.
Examiner :
Teacher:
School Stamp:
Principal:
Cerfiticate
This is to certify that harsh singh of class
12th A has successfully completed the investigation work on
physics for Class Xll practical examination of the central board of
secondary
Education in the year 2017-2018 It is futher certified that this
Project is the group work.
Examiner :
Teacher:
School Stamp:
Principal:
Cerfiticate
This is to certify that adesh yadav of class
12th A has successfully completed the investigation work on
physics for Class Xll practical examination of the central board of
secondary
Education in the year 2017-2018 It is futher certified that this
Project is the group work.
Examiner :
Teacher:
School Stamp:
Principal:
acknowledgement
I’M VERY THANKFUL TO EVERYONE WHO ALL
SUPPORTED ME FOR COMPLETING MY PROJECT
EFFECTIVELY AND MORE EVER ON TIME.
I’M EQUALLY GRATEFUL TO COMPUTER SCIENCE
TEACHER FOR PROVIDING ALL TYPES OF
CONCEPT & ALL OTHER REQUIREMENT.
THANK S TO MY TEACHER
HEADER FILES USED
IOSTREAM.h:->basic input output
Graphics.h:->graphical reprentaton
Process.h:->for end the function
Time.h:->base computer time cycle
Math.h;-.storing the number and
calculting
Fstream.h:->open new file by steam
management
Stdio.h:-> C Standard Input and Output
Library

Conio.h:-> C header file used mostly by


MS-DOS compilers to provide console
input/output.

Dos.h:-> facilitate calls to System API and


the OS
Advantage of housing society in
way computerization
:->it can stored massive data
:->it easy way of well defined
data classification
:->it is a fastest and convient way
of process
:->always update with time
/*HOUSING SOCIETY*/

#include<iostream.h>
#include<graphics.h>
#include<process.h>
#include<time.h>
#include<math.h>
#include<fstream.h>
#include<stdio.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
class house
{
char name[20],fname[20],cadd[40],padd[40],bankname[30],dob[20];
int age,plot_size;
char date[25];
long int cost,acc_no,inc_taxno,cheque_no;
public: unsigned int reg;
void input();
void output();
long int plot_sizes(void)
{
if(plot_size==100)
cost=1000000;
else if(plot_size==200)
cost=2000000;
else if(plot_size==250)
cost=2500000;
else if(plot_size==300)
cost=3000000;
return cost;
}
};
void house::input()
{
clrscr();
int i,j;
char a,z;
a=175;
gotoxy(2,1);
for(i=1;i<=78;i++)
cout<<(char)240;
j=1;
for(i=1;i<=24;i++)
{
gotoxy(2,j);
cout<<(char)173;
gotoxy(80,j);
cout<<(char)173;
j++;
}
gotoxy(2,24);
for(i=1;i<=78;i++)
{
cout<<(char)240;
}
gotoxy(20,3);
cout<<"\t REGISTRATION FORM\n";
gotoxy(4,6);
cout<<"NAME "<<a;
gotoxy(4,8);
cout<<"FATHER'S/HUSBAND'S NAME "<<a;
gotoxy(4,10);
cout<<"CORRESPONDANCE ADDRESS "<<a;
gotoxy(4,12);
cout<<"PERMANENT ADDRESS "<<a;
gotoxy(4,14);
cout<<"DATE OF BIRTH "<<a;
gotoxy(4,16);
cout<<"AGE "<<a;
gotoxy(4,18);
cout<<"PLOT SIZE(100,200,250,300)"<<a;
gotoxy(31,6);
gets(name);
gotoxy(31,8);
gets(fname);
gotoxy(31,10);
gets(cadd);
gotoxy(31,12);
gets(padd);
gotoxy(31,14);
gets(dob);
gotoxy(31,16);
cin>>age;
gotoxy(31,18);
cin>>plot_size;
clrscr();
gotoxy(2,1);
for(i=1;i<=78;i++)
cout<<(char)240;
j=1;
for(i=1;i<=24;i++)
{
gotoxy(2,j);
cout<<(char)173;
gotoxy(80,j);
cout<<(char)173;
j++;
}
gotoxy(2,24);
for(i=1;i<=78;i++)
{
cout<<(char)240;
}
gotoxy(15,2);
cout<<"ENTER BANK DETAILS\n";
gotoxy(4,7);
cout<<"ACCOUNT NUMBER "<<a;
gotoxy(4,9);
cout<<"INCOME-TAX NO "<<a;
gotoxy(4,11);
cout<<"BANK NAME "<<a;
gotoxy(4,13);
cout<<"DATE OF REGISTRATION "<<a;
gotoxy(4,15);
cout<<"CHEQUE NUMBER "<<a;
gotoxy(31,7);
cin>>acc_no;
gotoxy(31,9);
cin>>inc_taxno;
gotoxy(31,11);
gets(bankname);
gotoxy(31,13);
gets(date);
gotoxy(31,15);
cin>>cheque_no;
reg++;
}
void house::output(void)
{ clrscr();
clrscr();
int i,j;
char a,z;
a=175;
gotoxy(2,1);
for(i=1;i<=78;i++)
cout<<(char)240;
j=1;
for(i=1;i<=24;i++)
{
gotoxy(2,j);
cout<<(char)173;
gotoxy(80,j);
cout<<(char)173;
j++;
}
gotoxy(2,24);
for(i=1;i<=78;i++)
{
cout<<(char)240;
}
gotoxy(4,2);
cout<<"NAME "<<a;
gotoxy(4,4);
cout<<"FATHER'S/HUSBAND'S NAME "<<a;
gotoxy(4,6);
cout<<"CORRESPONDANCE ADDRESS "<<a;
gotoxy(4,8);
cout<<"PERMANENT ADDRESS "<<a;
gotoxy(4,10);
cout<<"DATE OF BIRTH "<<a;
cout<<"\t\tAGE "<<a;
gotoxy(4,12);
cout<<"PLOT SIZE(100,200,250,300)"<<a;
gotoxy(4,14);
cout<<"ACCOUNT NO "<<a;
gotoxy(4,16);
cout<<"INCOME TAX NO "<<a;
gotoxy(4,18);
cout<<"BANK NAME "<<a;
gotoxy(4,20);
cout<<"DATE OF REGISTRATION "<<a;
gotoxy(4,22);
cout<<"CHEQUE NO "<<a;
gotoxy(31,2);
cout<<name;
gotoxy(31,4);
cout<<fname;
gotoxy(31,6);
cout<<cadd;
gotoxy(31,8);
cout<<padd;
gotoxy(31,10);
cout<<dob;
gotoxy(58,10);
cout<<age;
gotoxy(31,12);
cout<<plot_size;
gotoxy(31,14);
cout<<acc_no;
gotoxy(31,16);
cout<<inc_taxno;
gotoxy(31,18);
cout<<bankname;
gotoxy(31,20);
cout<<date;
gotoxy(31,22);
cout<<cheque_no;
long int aa=plot_sizes();
gotoxy(31,23);
cout<<"AMOUNT RECEIVED: "<<aa;
cout<<"\n\n\n\n\nRegistration number="<<reg<<"\n\n";

}
/*1st function*/
void create(void)
{
house h;
ofstream fout;
fout.open("society",ios::out|ios::binary);
if(!fout)
{
cout<<"Cannot create the file\n";
return;
}
int n,i;
cout<<"ENTER THE NO OF FORMS TO BE FILLED\n";
cin>>n;
for(i=0;i<n;i++)
{
h.input();
clrscr();
int i,j;
gotoxy(10,2);
for(i=1;i<=60;i++)
cout<<(char)179;
j=3;
for(i=1;i<=10;i++)
{
gotoxy(10,j);
cout<<(char)196;
gotoxy(69,j);
cout<<(char)196;
j++;
}
gotoxy(10,12);
for(i=1;i<=60;i++)
{
cout<<(char)179;
}
gotoxy(25,7);
cout<<"Registration number="<<h.reg<<"\n\n";
delay(5000);
clrscr();
fout.write((char*)&h,sizeof(h));
}
fout.close();
}
/*2nd function*/
void read(void)
{
house h;
ifstream fin;
fin.open("society",ios::in|ios::binary);
if(!fin)
{
cout<<"Cannot read the file\n";
return;
}
fin.seekg(0);
fin.read((char*)&h,sizeof(h));
while(!fin.eof())
{
h.output();
fin.read((char*)&h,sizeof(h));
gotoxy(0,49);
cout<<"PRESS ANY KEY TO CONTINUE\n";
getch();
}
fin.close();
}
//3rd function
void search(int n)
{
house h;
fstream f;
f.open("society",ios::in|ios::binary);
if(!f)
{
cout<<"Cannot read the file\n";
return;
}
cout<<"Enter the number to be searched\n";
cin>>n;
while(f.read((char*)&h,sizeof(h)))
{
if(n==h.reg)
{
cout<<"\nApplicants detail is as follows.\n\n";
h.output();
break;
}
else
{
cout<<"\nNo such number found\n";
break;
}
}
cout<<"\n\nPRESS ANY KEY TO CONTINUE";
getch();
}
//4th Function
void deleted(int n)
{
house h;
fstream fin;
fin.open("society",ios::in|ios::binary);
if(!fin)
{
cout<<"cannot open the file\n";
return;
}
fstream f;
f.open("temp",ios::out|ios::binary);
if(!f)
{
cout<<"Cannot open the file\n";
return;
}
cout<<"Enter the record to be removed\n";
cin>>n;
int flag=0;
while(fin.read((char*)&h,sizeof(h)))
{
if(n!=h.reg)
f.write((char*)&h,sizeof(h));
else
flag=1;
}
if(flag==0)
{
cout<<"No such number found\n";
}
else
cout<<"Record deleted \n";
f.close();
fin.close();
remove("society");
rename("temp","society");
getch();
}
//5th Function
void modify()
{
house h;
fstream f;
f.open("society",ios::out|ios::in|ios::binary);
int rec,flag;
rec=flag=0;
int no;
cout<<"Enter the number to be modified.\n";
cin>>no;
while(f.read((char*)&h,sizeof(h)))
{
rec++;
if(no==h.reg)
{
cout<<"To see the current details press any key.\n";
getch();
h.output();
getch();
cout<<"To enter the new details press any key.\n";
getch();
h.input();
h.reg--;
f.seekg((rec-1)*sizeof(h),ios::beg);
f.write((char*)&h,sizeof(h));
flag=1;
}
}
f.close();
if(flag==0)
{
cout<<"No such number found\n";
}
getch();
}
//6th Function
void random_ise()
{
int x,y,a;
cout<<"Enter the first and the last term\n";
cin>>x>>y;
if(x>y)
{
cout<<"The first term should be small\n";
getch();
return;
}
randomize();
a=random(x+y-1)+x;
int i,j;
gotoxy(10,5);
for(i=1;i<=30;i++)
cout<<(char)1<<" ";
j=6;
for(i=1;i<=10;i++)
{
gotoxy(10,j);
cout<<(char)1;
gotoxy(68,j);
cout<<(char)1;
j++;
}
gotoxy(10,16);
for(i=1;i<=30;i++)
{
cout<<(char)1<<" ";
}
gotoxy(20,10);
cout<<"WINNER'S OF THE SOCIETY ALLOTMENT ARE="<<900+a<<"\n\n";
getch();
}
//7th function
void result(int a,int b)
{
if(a==21||a>=1&&b>=2009)
{
random_ise();
}
else
cout<<"Wait for next date\n";
}
//8th Function
void help(void)
{
int i,j;
gotoxy(10,2);
for(i=2;i<=61;i++)
cout<<(char)174;
j=3;
for(i=1;i<=14;i++)
{
gotoxy(10,j);
cout<<(char)176;
gotoxy(69,j);
cout<<(char)176;
j++;
}
gotoxy(10,17);
for(i=2;i<=61;i++)
{
cout<<(char)174;
}
gotoxy(15,7);
cout<<"\t FOR ANY QUERIES WRITE US AT\n";
gotoxy(22,9);
cout<<" ' noida_auth@yahoo.co.in '\n";
getch();
}
//9th Function
void intro(void)
{
int i,j;
gotoxy(10,2);
struct date d;
getdate(&d);
int d1=d.da_day;
int m1=d.da_mon;
int y1=d.da_year;
gotoxy(60,1);
cout<<"DATE:"<<d1<<"/"<<m1<<"/"<<y1;
struct dostime_t t;
_dos_gettime(&t);
int h1=t.hour;
int m2=t.minute;
int s1=t.second;
gotoxy(60,2);
cout<<"TIME:"<<h1<<":"<<m2<<":"<<s1;

cout<<" _____ _______ _______ _____ \n";


cout<<"|\\ | | | | | | | | \n";
cout<<"| \\ | | | | | | | | \n";
cout<<"| \\ | | | | | | |_____| \n";
cout<<"| \\ | | | | | | | | \n";
cout<<"| \\| |_____| ___|___ _|_____| | | \n";
cout<<"\n\n";
cout<<" ______ _______
\n";
cout<<" | | | | | | | \n";
cout<<" | | | | | | | \n";
cout<<" |______| | | | |______| \n";
cout<<" | | | | | | | \n";
cout<<" | | |______| | | | [*]
\n";
delay(6000);
clrscr();
gotoxy(10,2);
for(i=1;i<=60;i++)
cout<<(char)240;
j=3;
for(i=1;i<=19;i++)
{
gotoxy(10,j);
cout<<(char)173;
gotoxy(69,j);
cout<<(char)173;
j++;
}
gotoxy(10,22);
for(i=1;i<=60;i++)
{
cout<<(char)240;
}
gotoxy(54,5);
cout<<"DATE:"<<d1<<"/"<<m1<<"/"<<y1;
gotoxy(54,6);
cout<<"TIME:"<<h1<<":"<<m2<<":"<<s1;
gotoxy(26,8);
cout<<"NOIDA AUTHORITY PLOTS\n";
gotoxy(16,10);
delay(1000);
cout<<" Plot size\t\t cost\n";
delay(1000);
gotoxy(16,11);
cout<<" 100 \t\t 10lac\n";
gotoxy(16,12);
delay(1000);
cout<<" 200 \t\t 20lac\n";
gotoxy(16,13);
delay(1000);
cout<<" 250 \t\t 30lac\n";
gotoxy(16,14);
delay(1000);
cout<<" 300 \t\t 40lac\n\n";
gotoxy(16,16);
cout<<"Press any key to continue\n";
gotoxy(16,17);
getch();
clrscr();
}
//10th Function
void Exit(void)
{
clrscr();
char Z[20]={'T','H','A','N','K',' ','Y','O','U'};
gotoxy(36,19);
for(int i=0;Z[i]!='\0';i++)
{
cout<<Z[i];
delay(150);
}
delay(2000);
char Y[20]={'A',' ','P','R','O','J','E','C','T',' ','B','Y'};
gotoxy(34,21);
for(i=0;Y[i]!='\0';i++)
{
cout<<Y[i];
delay(150);
}
delay(1000);
char a[20]={'D','E','E','P','A','N','S','H','U','H',’A’,’R’,’S’,’H’,
’A’,’N’,’D',’ ','A','D','E','S',’H’};
gotoxy(33,23);
for(i=0;a[i]!='\0';i++)
{
cout<<a[i];
delay(150);
}
delay(2000);
char b[20]={'X','I','I','-','A',' ','C','S'};
gotoxy(36,25);
for(int j=0;b[j]!='\0';j++)
{
cout<<b[j];
delay(150);
}
delay(3000);
return;
}
void main()
{
house h;
int n,c;
clrscr();
char ch;
clrscr();
intro();
int i,j;
do
{
gotoxy(10,2);
for(i=1;i<=60;i++)
cout<<"=";
j=3;
for(i=1;i<=19;i++)
{
gotoxy(10,j);
cout<<"|";
gotoxy(69,j);
cout<<"|";
j++;
}
gotoxy(10,22);
for(i=1;i<=60;i++)
{
cout<<"=";
}
struct date d;
getdate(&d);
int d1=d.da_day;
int m1=d.da_mon;
int y1=d.da_year;
gotoxy(55,5);
cout<<"DATE:"<<d1<<"/"<<m1<<"/"<<y1;
struct dostime_t t;
_dos_gettime(&t);
int h1=t.hour;
int m2=t.minute;
int s1=t.second;
gotoxy(55,6);
cout<<"TIME:"<<h1<<":"<<m2<<":"<<s1;
gotoxy(12,8);
cout<<"\t\t SEARCH MENU\n";
gotoxy(12,10);
cout<<"1 INSERT DATA\n";
gotoxy(12,11);
cout<<"2 DISPLAY ALL\n";
gotoxy(12,12);
cout<<"3 SEARCH\n";
gotoxy(12,13);
cout<<"4 MODIFY\n";
gotoxy(12,14);
cout<<"5 LUCKY DRAW\n";
gotoxy(12,15);
cout<<"6 DELETE\n";
gotoxy(12,16);
cout<<"7 HELP\n";
gotoxy(12,17);
cout<<"8 EXIT\n";
gotoxy(12,18);
cout<<"Enter your choice\n";
gotoxy(12,19);
cin>>c;
clrscr();
switch(c)
{
case 1: create();
break;
case 2: read();
break;
case 3: search(n);
break;
case 4: modify();
break;
case 5: result(d1,y1);
break;
case 6: deleted(n);
break;
case 7: help();
break;
case 8: clrscr();
Exit();
return;
default: cout<<"Sorry! Wrong choice\n";
}
cout<<"\n\n\n\n";
clrscr();
gotoxy(25,13);
cout<<"WANT TO CONTINUE(Y/N):\n";
gotoxy(25,14);
cin>>ch;
clrscr();
}while(ch=='Y'||ch=='y');
}

// A PROJECT BY Deepanshu harsh ansd adesh


//XII-A

You might also like