Program for St. Xavier's
#include<dos.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<dos.h>
#include<graphics.h>
void menu();
void second();
void intro();
void last()
{
int a=getmaxx(),b=getmaxy(),c=getmaxcolor(),d=getmaxx()/2,e=getmaxy()/2;
char f,g,h;
clrscr();
setcolor(0);
setbkcolor(0);
setfillstyle(1,0);
rectangle(0,0,650,480);
floodfill(1,1,0);
setcolor(4);
printf("\n\n\n\n\n\n\n\n\n\n\t\t\t Do u want to continue : ");
for (int z=0;z<20;z++)
{
setcolor(z/5);
rectangle(0+z,0+z,a-z,b-z);
}
scanf("%s",&f);
if (f=='y' || f=='Y')
{
intro();
}
else
{
printf("\n\n\n\n\n\n\n\t\t\tEnter password to continue : ");
for (int z=0;z<20;z++)
{
setcolor(z/5);
rectangle(0+z,0+z,a-z,b-z);
}
scanf("%s",&g);
if (g=='q' || g=='Q')
{
exit(0);
}
else
{
settextstyle(1,0,1);
outtextxy(230,350,"Password incorrect");
outtextxy(200,390,"Press any key to continue :");
getch();
intro();
}
}
getch();
}
void secondlast()
{
int a=getmaxx(),b=getmaxy(),c=getmaxcolor(),d=getmaxx()/2,e=getmaxy()/2;
char f,g,h;
clrscr();
setcolor(1);
setbkcolor(9);
setfillstyle(5,1);
rectangle(0,0,650,480);
floodfill(1,1,1);
for (int z=5;z<25;z++)
{
setcolor(z/5);
rectangle(-5+z,-5+z,a-z+5,b-z+5);
}
setcolor(14);
settextstyle(4,0,5);
outtextxy(192,200,"Have a nice day");
settextstyle(1,0,2);
outtextxy(180,310,"Press any key to continue :->");
getch();
last();
}
void review()
{
int a=getmaxx(),b=getmaxy(),c=getmaxcolor(),d=getmaxx()/2,e=getmaxy()/2;
char f,g[100],h;
clrscr();
setcolor(0);
setbkcolor(0);
setfillstyle(1,0);
rectangle(0,0,650,480);
floodfill(1,1,0);
setcolor(4);
settextstyle(1,0,3);
outtextxy(255,50,"Your review");
printf("\n\n\n\n\n\n\n\n\n\t\t\tWhat need to be improved : ");
for (int z=10;z<30;z++)
{
setcolor(z/5);
rectangle(-10+z,-10+z,a-z+10,b-z+10);
}
scanf("%s",&g);
settextstyle(1,0,1);
outtextxy(50,250,"Thank u for your review. We will improve in next update");
outtextxy(150,310,"Press any key to continue ->");
getch();
secondlast();
}
void program()
{
int a=getmaxx(),b=getmaxy(),c=getmaxcolor(),d=getmaxx()/2,e=getmaxy()/2;
char f,g[100],h;
clrscr();
setcolor(3);
setbkcolor(3);
setfillstyle(1,3);
rectangle(0,0,650,480);
floodfill(1,1,3);
setcolor(1);
settextstyle(2,0,7);
outtextxy(250,50,"Your comment");
printf("\n\n\n\n\n\n\n\n\n\n\n\t\t\tHow was the program : ");
for (int z=15;z<35;z++)
{
setcolor(z/5);
rectangle(-15+z,-15+z,a-z+15,b-z+15);
}
scanf("%s",&g);
setcolor(1);
outtextxy(180,300,"Thank u for your comment!");
outtextxy(165,340,"Press any key to continue ->");
getch();
review();
}
void tree()
{
int a=getmaxx(),b=getmaxy(),c=getmaxcolor(),d=getmaxx()/2,e=getmaxy()/2;
clrscr();
setbkcolor(0);
setcolor(0);
setfillstyle(1,0);
rectangle(0,0,a,b);
floodfill(1,1,0);
setcolor(15);
settextstyle(3,0,4);
outtextxy(210,10,"Merry Christmas");
settextstyle(3,0,3);
outtextxy(300,45,"2019");
setcolor(6);
setfillstyle(1,6);
rectangle(95,318,105,430);
floodfill(96,319,6);
rectangle(515,318,525,430);
floodfill(516,319,6);
rectangle(305,318,315,430);
floodfill(306,319,6);
setcolor(GREEN);
setfillstyle(1,GREEN);
pieslice(100,215,238,302,40);
floodfill(101,216,GREEN);
pieslice(100,235,230,310,45);
floodfill(101,236,GREEN);
pieslice(100,260,220,320,50);
floodfill(101,261,GREEN);
pieslice(100,290,215,325,55);
floodfill(101,291,GREEN);
pieslice(100,320,207,333,60);
floodfill(101,321,GREEN);
///right tree ///
pieslice(520,215,238,302,40);
pieslice(520,235,230,310,45);
pieslice(520,260,220,320,50);
pieslice(520,290,215,325,55);
pieslice(520,320,207,333,60);
// big tree//
pieslice(310,140,240,300,60);
pieslice(310,175,228,312,65);
pieslice(310,215,216,324,70);
pieslice(310,255,210,330,75);
pieslice(310,300,205,335,80);
line(0,b-48,a,b-48);
for (int k=0;k<640;k+=24)
{
for (int l=80;l<425;l+=30)
{
putpixel(k,l,15);
putpixel(k+1,l+1,15);
putpixel(k,l+1,15);
putpixel(k+1,l,15);
putpixel(k+2,l+2,15);
putpixel(k+1,l+2,15);
putpixel(k+2,l+1,15);
putpixel(k+2,l+3,15);
putpixel(k+3,l+2,15);
putpixel(k+3,l+3,15);
putpixel(k+3,l+4,15);
putpixel(k+4,l+3,15);
putpixel(k+4,l+4,15);
// //
putpixel(k+2,l+2,15);
putpixel(k+2,l,15);
putpixel(k+3,l,15);
putpixel(k+3,l+3,15);
putpixel(k+4,l,15);
putpixel(k+4,l+4,15);
// //
putpixel(k+2,l+1,15);
putpixel(k,l+1,15);
putpixel(k+3,l+1,15);
putpixel(k,l+1,15);
putpixel(k+4,l+1,15);
putpixel(k,l+1,15);
/// //
putpixel(k+2,l+2,15);
putpixel(k,l+2,15);
putpixel(k+3,l+2,15);
putpixel(k,l+2,15);
putpixel(k+4,l+2,15);
putpixel(k,l+2,15);
setcolor(15);
setfillstyle(1,15);
circle(0+k/3,418,7+(l/60));
floodfill(0+k/3,418,15);
circle(-250+k+l,418,7+(l/40));
floodfill(-250+k+l,418,15);
}
}
getch();
program();
}
void detail()
{
int a=getmaxx(),b=getmaxy();
clrscr();
setcolor(0);
setbkcolor(0);
setfillstyle(1,0);
rectangle(0,0,650,480);
floodfill(1,1,0);
setcolor(1);
settextstyle(1,0,2);
outtextxy(190,100," Thank u for coming ");
outtextxy(190,140,"and using this program");
outtextxy(50,200," Contact me on:");
settextstyle(2,0,6);
outtextxy(50,240,"Facebook : Roshan thapa");
outtextxy(50,260,"Website : englishfreewritingforeveryone.blogspot.com");
outtextxy(50,280,"To learn more about C programming");
settextstyle(1,0,1);
outtextxy(180,350,"Press any key to continue :->");
for (int z=20;z<40;z++)
{
setcolor(z/5);
rectangle(-20+z,-20+z,a-z+20,b-z+20);
}
getch();
tree();
}
void record()
{
clrscr();
setcolor(0);
setbkcolor(0);
setfillstyle(1,0);
rectangle(0,0,650,450);
floodfill(1,1,0);
setcolor(4);
char a[20],b[20],c[20],d[30],e,f,p[50],q[20],r[20],s[30];
int g;
FILE *file=fopen("record.txt","w");
printf("\n\n\tEnter your First name: ");
scanf("%s",&a);
printf("\n\tEnter your Last name: ");
scanf("%s",&b);
printf("\n\tEnter your Parent's name: ");
scanf("%s",&c);
printf("\n\tEnter your Address: ");
scanf("%s",&d);
printf("\n\tEnter your School name: ");
scanf("%s",&p);
printf("\n\tEnter your roll no: ");
scanf("%s",&q);
printf("\n\tEnter your age: ");
scanf("%s",&r);
printf("\n\tEnter your aim: ");
scanf("%s",&s);
fprintf(file,"%s\n",a);
fprintf(file,"%s\n",b);
fprintf(file,"%s\n",c);
fprintf(file,"%s\n",d);
fprintf(file,"%s\n",p);
fprintf(file,"%s\n",q);
fprintf(file,"%s\n",r);
fprintf(file,"%s\n",s);
outtextxy(200,5,"Press 'y' to continue ahead.");
printf("\n\n\n\t\tDo u want to see your records:");
scanf("%s",&e);
fclose(file);
if (e=='y' || e=='Y')
{
clrscr();
setbkcolor(1);
setcolor(1);
setfillstyle(1,1);
rectangle(0,0,650,480);
floodfill(1,1,1);
setcolor(15);
char g[20],h[20],i[20],j[30],e,f,w[20],x[20],y[20],z[30];
setcolor(4);
outtextxy(180,50,"******** Student's Record ********");
FILE *open=fopen("record.txt","r");
fscanf(open,"%s\n",&g);
printf("\n\n\n\n\n\n\n\t %s",g);
fscanf(open,"%s\n",&h);
printf("\t\t %s",h);
fscanf(open,"%s\n",&i);
printf("\t\t %s",i);
fscanf(open,"%s\n",&j);
printf("\t\t %s",j);
fscanf(open,"%s\n",&w);
printf("\n\n\n\n\n\n\n\n\t%s",w);
fscanf(open,"%s\n",&x);
printf("\t\t%s",x);
fscanf(open,"%s",&y);
printf("\t\t %s",y);
fscanf(open,"%s",&z);
printf("\t\t %s",z);
setcolor(15);
rectangle(20,70,620,380);
line(170,70,170,380);
line(320,70,320,380);
line(480,70,480,380);
getch();
printf("\n\n\n\n\n\n\n\n\t\t\t\tDo your want to continue: ");
scanf("%s",&f);
fclose(open);
if (f=='y' || f=='Y')
{
detail();
}
}
getch();
}
void loadrecord()
{
clrscr();
setbkcolor(1);
setcolor(1);
setfillstyle(1,1);
rectangle(0,0,650,480);
floodfill(1,1,1);
setcolor(15);
char g[20],h[20],i[20],j[30],e,f,w[20],x[20],y[20],z[30];
setcolor(4);
outtextxy(180,50,"******** Student's Record ********");
FILE *open=fopen("record.txt","r");
fscanf(open,"%s\n",&g);
printf("\n\n\n\n\n\n\n\t %s",g);
fscanf(open,"%s\n",&h);
printf("\t\t %s",h);
fscanf(open,"%s\n",&i);
printf("\t\t %s",i);
fscanf(open,"%s\n",&j);
printf("\t\t %s",j);
fscanf(open,"%s\n",&w);
printf("\n\n\n\n\n\n\n\n\t%s",w);
fscanf(open,"%s\n",&x);
printf("\t\t%s",x);
fscanf(open,"%s",&y);
printf("\t\t %s",y);
fscanf(open,"%s",&z);
printf("\t\t %s",z);
setcolor(15);
rectangle(20,70,620,380);
line(170,70,170,380);
line(320,70,320,380);
line(480,70,480,380);
getch();
printf("\n\n\n\n\n\n\n\n\t\t\t\tDo your want to continue: ");
scanf("%s",&f);
if (f=='y' || f=='Y')
{
menu();
}
}
void setting()
{
clrscr();
setbkcolor(3);
setcolor(3);
setfillstyle(1,3);
rectangle(0,0,650,480);
floodfill(1,1,3);
setcolor(15);
outtextxy(250,150,"This is not finished");
outtextxy(180,350,"Press any key to continue :->");
getch();
menu();
}
void contact()
{
clrscr();
setbkcolor(7);
setcolor(7);
setfillstyle(1,7);
rectangle(0,0,650,480);
floodfill(1,1,7);
setcolor(1);
settextstyle(1,0,2);
outtextxy(190,100," Thank u for coming ");
outtextxy(190,140,"and using this program");
outtextxy(50,200," Contact me on:");
settextstyle(2,0,6);
outtextxy(50,240,"Facebook : Roshan thapa");
outtextxy(50,260,"Website : englishfreewritingforeveryone.blogspot.com");
outtextxy(50,280,"To learn more about C programming");
settextstyle(1,0,1);
outtextxy(180,350,"Press any key to continue :->");
getch();
menu();
}
void helpandsupport()
{
clrscr();
setbkcolor(0);
setcolor(0);
setfillstyle(1,0);
rectangle(0,0,650,480);
floodfill(1,1,0);
setcolor(15);
settextstyle(1,0,2);
outtextxy(180,140,"Click on create new record");
outtextxy(180,170,"Fill your infromation below");
outtextxy(180,200,"Then do what it say's to do");
outtextxy(180,350,"Press any key to continue :->");
getch();
menu();
}
void menu()
{
clrscr();
int a=getmaxx(),b=getmaxy(),c=getmaxcolor(),d=getmaxx()/2,e=getmaxy()/2;
char key;
clrscr();
setbkcolor(1);
setcolor(1);
setfillstyle(1,1);
rectangle(0,80,650,420);
floodfill(0,0,1);
floodfill(50,200,GREEN);
setcolor(13);
line(0,75,a,75);
line(0,405,a,405);
for (int o=0;o<=5;o++)
{
setcolor(RED);
rectangle(10+o,90+o,a-10-o,b-90-o);
setcolor(GREEN);
rectangle(25+o,105+o,a-25-o,b-105-o);
}
// menu box //
setcolor(YELLOW);
settextstyle(15,0,4);
outtextxy(0,79,"===================================== MENU ======================================");
rectangle(d-70,130,d+85,155);
rectangle(d-70,170,d+85,195);
rectangle(d-70,210,d+85,235);
rectangle(d-70,250,d+85,275);
rectangle(d-70,290,d+85,315);
rectangle(d-70,330,d+85,355);
// side border of the menu //
outtextxy(0,392,"=================================================================================");
outtextxy(17,97,"============================================================================");
outtextxy(17,375,"============================================================================");
settextstyle(15,1,4);
outtextxy(8,86,"======================================");
outtextxy(a,86,"======================================");
outtextxy(24,102,"==================================");
outtextxy(a-16,102,"==================================");
// menu content //
settextstyle(14,0,1);
outtextxy(d-60,137,"Create new record ");
outtextxy(d-65,180," Load Data ");
outtextxy(d-65,219," Setting ");
outtextxy(d-66,260," Help and Support ");
outtextxy(d-65,300," Contact ");
outtextxy(d-63,340," Exit program ");
outtextxy(0,440," N/n - C.n.r ");
outtextxy(100,440," L/l - Load ");
outtextxy(205,440," S/s - Sett.");
outtextxy(310,440," H/h - Help ");
outtextxy(415,440," C/c - Cont. ");
outtextxy(520,440," E/e - Exit ");
outtextxy(250,380,"Enter your choice : ");
scanf("\n\n\n\n%s",&key);
cleardevice();
switch(key)
{
case 'n':
{
record();
break;
}
case 'l':
{
loadrecord();
break;
}
case 's':
{
setting();
break;
}
case 'h':
{
helpandsupport();
break;
}
case 'c':
{
contact();
break;
}
case 'e':
{
exit(0);
}
}
getch();
}
void looping()
{
clrscr();
setcolor(4);
do
{
for (int n;n<=400;n++)
{
settextstyle(1,0,3);
sound(n*n+n);
setcolor(n/13);
outtextxy(120,20+n,"Press any key to continue program...");
delay(1);
setbkcolor(n/24);
delay(20);
cleardevice();
delay(1);
if (kbhit()){break;}
}
n=0;
if (kbhit()){break;}
}
while(1);
nosound();
cleardevice();
menu();
}
void second()
{
int a=getmaxx(),b=getmaxy(),c=getmaxcolor(),d=getmaxx()/2,e=getmaxy()/2;
clrscr();
// border for the page //
for (int j=0;j<10;j++)
{
setcolor(BLUE);
rectangle(0+j,0+j,a-j,b-j);
setcolor(RED);
rectangle(-4+j,-4+j,a-j+4,b-j+4);
setcolor(GREEN);
rectangle(3+j,3+j,a-j-3,b-j-3);
}
setbkcolor(7);
setcolor(4);
settextstyle(4,0,5);
// loading for Enter any key //
outtextxy(10,40,"Welcome to the Science fair 2019");
settextstyle(4,0,4);
outtextxy(93,110,"Organized by St. Xavier's School");
outtextxy(200,160,"Jawalakhel,Lalitpur");
getch();
for (int q=0;q<=16;q++)
{
setcolor(q);
setfillstyle(1,q);
rectangle(140,345,500,385);
floodfill(141,346,q);
delay(100);
setcolor(q+2);
settextstyle(1,0,3);
outtextxy(160,350,"Enter any key to continue....");
delay(100);
if (kbhit()){break;}
}
getch();
getch();
looping();
}
void first()
{
int a=getmaxx(),b=getmaxy(),c=getmaxcolor(),d=getmaxx()/2,e=getmaxy()/2;
setbkcolor(c);
setcolor(BLUE);
settextstyle(4,0,5);
outtextxy(160,50,"St.Xavier's School");
settextstyle(4,0,2);
outtextxy(240,110,"Jawalakhel,Lalitpur");
setlinestyle(3,8,15);
line(160,95,483,95);
// curtain design //
// big pieslice //
setcolor(RED);
setfillstyle(1,RED);
pieslice(0,0,270,360,170);
floodfill(0,1,RED);
pieslice(a,0,180,270,170);
floodfill(a,1,RED);
//small pieslice //
pieslice(0,175,0,360,70);
floodfill(0,175,RED);
pieslice(a,175,90,270,70);
floodfill(a,175,RED);
//line downward //
for (int i=0;i<300;i++)
{
sound(i*i);
line(i/8,230,i/4,500);
line(a-(i/8),230,a-(i/4),500);
}
nosound();
getch();
// loading for Enter any key //
do
{
settextstyle(0,0,1);
setcolor(c);
outtextxy(240,400,"<<< >>>");
setcolor(RED);
delay(90);
outtextxy(240,400," Enter any key ");
delay(150);
if (kbhit()){break;}
setcolor(c);
outtextxy(240,400,"<<< >>>");
setcolor(RED);
delay(90);
outtextxy(240,400," < Enter any key > ");
delay(150);
if (kbhit()){break;}
setcolor(c);
outtextxy(240,400,"<<< >>>");
setcolor(RED);
delay(90);
outtextxy(240,400," << Enter any key >> ");
delay(150);
if (kbhit()){break;}
setcolor(c);
outtextxy(240,400,"<<< >>>");
setcolor(RED);
delay(90);
outtextxy(240,400,"<<< Enter any key >>>");
delay(150);
if (kbhit()){break;}
}
while(1);
// overlapping looping //
for (int m=0;m<=321;m++)
{
sound(m*m);
setcolor(7);
line(0+m,0,0+m,b);
line(a-m,0,a-m,b);
delay(25-(321/14));
}
nosound();
cleardevice();
second();
}
void intro()
{
int a=getmaxx(),b=getmaxy(),c=getmaxcolor(),d=getmaxx()/2,e=getmaxy()/2;
char f,g,h;
clrscr();
setcolor(0);
setbkcolor(0);
setfillstyle(1,0);
rectangle(0,0,650,480);
floodfill(1,1,0);
setcolor(4);
clrscr();
do
{
for (int j=0;j<950;j++)
{
settextstyle(2,0,9);
outtextxy(a-j,50,"<- Welcome to the mini project from C programming");
outtextxy(a-j+35,140,"<- This program allow to record student's data ");
outtextxy(a-j+50,230,"<- From the side of Computer Science");
outtextxy(a-j+40,410,"-Created by Class 11 'D' Science stream");
delay(4);
if (kbhit()){break;}
cleardevice();
}
if (kbhit()){break;}
}
while(1);
cleardevice();
clrscr();
first();
}
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc3\\bgi");
intro();
getch();
closegraph();
}
Nov 23, 2019
c programming for science fair 2019
Tags

About Your helper
Soratemplates is a blogger resources site is a provider of high quality blogger template with premium looking layout and robust design. The main mission of templatesyard is to provide the best quality blogger templates.
Subscribe to:
Post Comments (Atom)
About Me

- Your helper
- Well speaking of myself I am a thin guy with lots of hobby and a passionate guy. I am learning some programming languages and trying to have some earning with it. Right now I am a student struggling in the study.
No comments:
Post a Comment