You are on page 1of 2

#include<utility.

h>
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#include<conio.h>
#include<windows.h>

void screen4()
{
//screen 4
clearportion(49,10,85,21);
line1(4,2,90,24);
line1(6,3,88,23);
line1(8,4,86,8);
center(5,"Polytechnic University of the Phils.");
center(6,"San Juan Campus");
center(7,"San Juan City");
line1(8,9,45,22);
line1(48,9,86,22);
printxy(60,16,"AAAAAAAAAAAAAAAAAA");
line1(15,10,38,12); //MAIN MENU
printxy(23,11,"Main Menu");
printxy(12,13,"A] Create a new file");
printxy(12,15,"B] Add a record");
printxy(12,17,"C] Browse");
printxy(12,19,"D] Close");
printxy(20,21,"Select an option");
line1(4,25,90,27);
center(26,"Reserve for error message");
getch();
system("cls");
}

char screen1()
{
char ans=' ';
//screen 1
line1(4,2,90,24);
line1(6,3,88,23);
line1(8,4,86,8);
center(5,"Polytechnic University of the Phils.");
center(6,"San Juan Campus");
center(7,"San Juan City");
line1(8,9,45,22);
line1(48,9,86,22);
printxy(60,14,"Programmed");
printxy(60,16,"By: AJI");
line1(15,10,38,12); //MAIN MENU
printxy(23,11,"Main Menu");
printxy(12,13,"A] Create a new file");
printxy(12,15,"B] Add a record");
printxy(12,17,"C] Browse");
printxy(12,19,"D] Close");
printxy(20,21,"Select an option");
line1(4,25,90,27);
center(26,"Reserve for error message");
// getch();
// system("cls");
gotoxy(37,21);gets;
ans=toupper(getch());
}

main()
{
struct Student_record
{
int sn;
char ln[20];
char fn[20];
char mi[10];
int pc;
}
record[3];

char ans=' ';

int x;
ans=screen1();

if (ans == 'B')
{
// screen 2
clearportion(49,10,85,21);
for(x=0;x<=2;x++)
{
printxy(50,10,"Student Number:");

printxy(50,12,"Last Name:");

printxy(50,14,"First Name:");

printxy(50,16,"M.I:");

printxy(50,18,"Program Code: ");

gotoxy(65,10);scanf("\n");scanf("%d",&record[x].sn);
gotoxy(60,12);scanf("\n");gets(record[x].ln);
gotoxy(61,14);gets(record[x].fn);
gotoxy(54,16);gets(record[x].mi);
gotoxy(63,18);scanf("\n");scanf("%d",&record[x].pc);

clearportion(49,10,85,21);
}
system("cls");
screen1();
return 1;

}
else if (ans =='D')
{
screen4();
}

You might also like