You are on page 1of 6

TUGAS

KELOMPOK
STOK BARANG

PROGRAM STOK BARANG C++


#include <conio.h>
#include <iostream.h>
#include <stdio.h>
#define max 10

char nama[max][25],kode[max][4],suply[max][25];
int harga[max];

void inputstok(){
char pil1;
int n=0;
do{
clrscr();

cout<<"\t\t\t+---------------------------------+\n";
cout<<"\t\t\t*---------------------------------*\n";
cout<<"\t\t\t*-----PROGRAM STOK BARANG C++-----*\n";
cout<<"\t\t\t+---------------------------------+\n\n";

cout<<"INPUT STOK\n";
cout<<"-----------\n\n";
cout<<"Nama Barang

:\n";

cout<<"Kode Barang(3) :\n";


cout<<"Nama suplier

:\n";

cout<<"Harga Barang

:\n";

gotoxy(18,9);gets(nama[n]);
gotoxy(18,10);gets(kode[n]);
gotoxy(18,11);gets(suply[n]);
gotoxy(18,12);cin>>harga[n];
cout<<"______________________";
cout<<endl;
cout<<endl;
n++;
if (n<max){
cout<<"Input Lagi??";cin>>pil1;
}else{cout<<"Maaf , untuk saat ini input max 10";getch();pil1='n';}
}while(pil1=='y'||pil1=='Y');
}

void lihatstok(){
clrscr();

cout<<"\t\t\t+---------------------------------+\n";
cout<<"\t\t\t*---------------------------------*\n";
cout<<"\t\t\t*-----PROGRAM STOK BARANG C++-----*\n";
cout<<"\t\t\t+---------------------------------+\n\n";
cout<<"LIHAT STOK\n";
cout<<"------------\n\n";

for(int n=0;n<max;n++)
{

cout<<(n+1)<<"\n";
cout<<"---------------------------------------\n";
cout<<"Nama Barang

:"<<nama[n]<<"\n";

cout<<"Kode Barang

:"<<kode[n]<<"\n";

cout<<"Nama Suplier

:"<<suply[n]<<"\n";

cout<<"Harga Barang

:"<<harga[n]<<"\n";

cout<<"_______________________________________\n\n";
}
getch();}

void main(){
int pil2;

do{
clrscr();
cout<<"\t\t\t+---------------------------------+\n";
cout<<"\t\t\t*---------------------------------*\n";
cout<<"\t\t\t*-----PROGRAM STOK BARANG C++-----*\n";
cout<<"\t\t\t+---------------------------------+\n\n";

cout<<"+---------+\n";
cout<<"| M.E.N.U |\n";

cout<<"+---------+\n\n";
cout<<"[1]. INPUT STOK BARU\n";
cout<<"[2]. LIHAT DATA STOK\n";
cout<<"[3]. KELUAR PROGRAM\n\n";

cout<<"pilihan anda [1/2/3] :";cin>>pil2;

switch(pil2) {
case 1:inputstok();break;
case 2:lihatstok();break;
case 3:goto akhir;
default : clrscr(); cout<<"Pilihan salah"; getch(); break;
}
akhir:
}while(pil2!=3);
}

TAMPILAN MENU UTAMA:

-TERIMA KASIH-

TAMPILAN INPUT STOK :

TERIMA KASIH

You might also like