Welcome to my blog

Friday, 29 October 2010

Bahasa Pemrograman

/*Istifaizah*/
/*0910095*/
/*DATA PENJUAlAN VIOLET CELL*/


#include
#include
#include
#include

void menu();
void input();
void cetak();
void keluar();

int dtpenjualanhp[4][7];
int tot[7];
int brs,kol;
char kode_hp,jns_hp,jwb;

void main()
{
textcolor(LIGHTBLUE);
textbackground(WHITE);
menu();
}

void menu()
{
int pil;
char ulang;
do
{
clrscr();
cout<<"++++++++++++MENU+++++++++++++++"<<<"|1.| Input |"<<<"+++++++++++++++++++++++++++++++"<<<"|2.| Cetak |"<<<"+++++++++++++++++++++++++++++++"<<<"|3.| Keluar |"<<<"+++++++++++++++++++++++++++++++"<<<"Pilihan Anda[1-3]:"; cin>>pil;
switch (pil)
{
case 1 : input();
break;
case 2 : cetak();
break;
case 3 : keluar();
break;
default: break;
}
cout<<<"Masih Melakukan Pengisian Data [Y/T]: ";cin>>ulang;
}
while (ulang=='y'||ulang=='Y');
}

void input()
{
clrscr();
gotoxy(25,1);cout<<"Data Penjualan Handphone"<<<"VIOLET CELL"<<<"Kode HP :";cin>>kode_hp;
if((kode_hp=='n')||(kode_hp=='N'))

{
gotoxy(1,4);cout<<"Nama Handphone :Nokia"<<<"Nama Handphone :Samsung"<<<"Nama Handphone :Siemens"<<<"Nama Handphone :Sony Ericson"<<<"Nama Handphone :Motorola"<<<"Nama Handphone :Philips"<<<"Jenis Handphone : ";cin>>jns_hp;
if((kode_hp=='r')||(jns_hp=='R'))
{
gotoxy(1,6);cout<<"Jenis Handphone :Comunicator"<<<"Jenis Handphone :Camera"<<<"Jenis Handphone :Comunicator"<<<"Jenis Handphone :Camera"<<<"========================================================================= "<<<"Merk HP | ITEM_1 ITEM_2 ITEM_3 ITEM_4 "<<<"========================================================================= "<<<"Nokia"<<<"Samsung"<<<"Siemens"<<<"Motorolla"<<<"Sony Ericson"<<<"Philip"<<<"Total"<>dtpenjualanhp[kol][brs];
tot[kol]=tot[kol] + dtpenjualanhp[kol][brs];
gotoxy(1+kol*15,17);
cout<
}
}

getch();
}
void cetak()
{
clrscr();
gotoxy(25,1);cout<<"Data Penjualan Handphpne"<
gotoxy(31,2);cout<<"VIOLET CELL"<
gotoxy(1,7);cout<<"========================================================================= "<
gotoxy(1,8);cout<<"Merk HP | ITEM_1 ITEM_2 ITEM_3 ITEM_4 "<
gotoxy(1,9);cout<<"========================================================================= "<
gotoxy(1,11);cout<<"Nokia"<
gotoxy(1,12);cout<<"Samsung"<
gotoxy(1,13);cout<<"Siemens"<
gotoxy(1,14);cout<<"Motorolla"<
gotoxy(1,15);cout<<"Sony Ericson"<
gotoxy(1,16);cout<<"Philip"<
gotoxy(1,17);cout<<"Total"<

for(kol=1;kol<=4;kol++)
{
tot[kol]=0;
for(brs=1;brs<=6;brs++)
{
gotoxy(1+kol*15,10+brs*1);
cout<
tot[kol]=tot[kol] + dtpenjualanhp[kol][brs];
gotoxy(1+kol*15,17);
cout<
}
}

getch();
}

void keluar()
{
clrscr();
cout<<"EXIT";
exit(1);
}


getch();





No comments: