PROGRAM FORM PENDAFTARAN
#include
<iostream.h>
#include <string.h>
#include <windows.h>
#include <conio.h>
void gotoxy(int x, int y)
{
HANDLE hConsoleOutput;
COORD dwCursorPosition;
dwCursorPosition.X = x;
dwCursorPosition.Y = y;
hConsoleOutput =
GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hConsoleOutput,dwCursorPosition);
}
int main ()
{ struct form { char
nama[20],fak[20],nim[20],kelas[20]; int pila;};
int pil,i,j,n;
form daftar[30];
do {
gotoxy(25,2);cout<<"
Registrasi Pelatihan Hacker \a \n";
gotoxy(25,3);cout<<"----------------------------- \n";
cout<<"\n";
cout<<" 1. Form Pendaftaran \n\n";
cout<<" 2. Tampilkan Data Peserta \n\n";
cout<<" 3. Keluar Program \n\n";
cout<<" ------------------------- \n";
/*Proses pemilihan*/
cout<<" Masukkan Pilihan : ";
cin>>pil;
cout<<"\a";
switch (pil)
{
case 1: {
/*proses inputan dari pendaftar*/
system("cls");
gotoxy(30,2);cout<<" Form Registrasi \n";
gotoxy(30,3);cout<<"------------------- \n";
cout<<"\nBerapa orang peserta
yang mau daftar saat ini : ";cin>>n;
for(i=1;i<=n;i++)
{cout<<" Data Peserta
ke-"<<i<<" : "<<endl;
cout<<"*******************"<<endl;
cout<<" Nama
: ";
cin>>daftar[i].nama;
cout<<"\a";
cout<<" Nim
: ";
cin>>daftar[i].nim;
cout<<"\a";
cout<<" Fakultas : ";
cin>>daftar[i].fak;
cout<<"\a";
cout<<" Kelas
: ";
cin>>daftar[i].kelas;
cout<<" \a \n";
cout<<" Pilih salah satu jadwal pelatihan Hacker :
\n\n";
cout<<" 1. 6 September 2014 \n";
cout<<" 2. 9 September 2014 \n";
cout<<" 3. 27 September 2014 \n";
cout<<" 4. 28 September 2014 \n";
cout<<" ------------------- \n";
/*proses pemilihan*/
cout<<" Silahkan masukkan pilihan : ";
cin>>daftar[i].pila;
cout<<"\a\n";}
cout<<" Pendaftaran selesai di
lakukan !";
cout<<"\n";
getch();
system ("cls");
break;}
case 2: {
system("cls");
cout<<"Data Anda \n";
cout<<"--------- \n";
for(j=1;j<i;j++)
{cout<<" Data Peserta
ke-"<<j<<" : "<<endl;
cout<<"*******************"<<endl;
cout<<"Nama :
"<<daftar[j].nama;cout<<"\n";
cout<<"Nim :
"<<daftar[j].nim;cout<<"\n";
cout<<"Fakultas :
"<<daftar[j].fak;cout<<"\n";
cout<<"Kelas :
"<<daftar[j].kelas;cout<<"\n";
cout<<"Waktu :
";
{if (daftar[j].pila==1)
cout<<"6 September 2014"<<endl; else if
(daftar[j].pila==2) cout<<"9 September 2014"<<endl;
else if (daftar[j].pila==3)
cout<<"27 September 2014"<<endl; else if
(daftar[j].pila==4) cout<<"28 September 2014"<<endl;
else cout<<"Pilihan tidak
terdeteksi";
cout<<endl;}}
getch();
system ("cls");
break;}
case 3: {
cout<<"\n";
cout<<"Thank You Sudah
Melakukan Registrasi :)";
cout<<"\n";
getch();
break;
}
}
}
while (daftar[i].pila!=0);
return 0;
while (pil!=3);
}
Posted in:
Pemrograman Terstruktur,
Semester2
0 komentar for "PROGRAM FORM PENDAFTARAN "
Leave a reply