Script C++. Pendaftaran Kursus Komputer

Berikut adalah script C++ Pendaftaran Kursus komputer. Disini saya menggunakan aplikasi Borland C++.
Ini merupakan contoh program aplikasi array satu dimensi

Pendaftaran Kursus


Source Code:
(klik 2x untuk seleksi)
/*Pendaftaran Kursus Komputer*/

#include<conio.h>
#include<stdio.h>
#include<iostream.h>
#include<iomanip.h>

main()
{

char nama[30],nim[10],lagi;
int i,j,total=0;

struct
{
char kode[4],materi[40];
int biaya;
}
kursus[10];

awal:
clrscr();
cout<<"PENDAFTARAN KURSUS KOMPUTER"<<endl;
cout<<"_____________________________________________________"<<endl;
cout<<"Masukkan Nama Siswa   = ";gets(nama);
cout<<"Masukkan NIM          = ";cin>>nim;
cout<<"Masukkan Jumlah Data  = ";cin>>j;
cout<<endl;
cout<<"Pilihan Materi Kursus"<<endl;
cout<<"of1 = Office (Word,Excel,Powerpoint)"<<endl;
cout<<"ph1 = Photoshop"<<endl;
cout<<"vb1 = Visual Basic"<<endl<<endl;
for (i=1;i<=j;i++)
{
cout<<"Masukkan Kode Materi Kursus= ";cin>>(kursus[i].kode);

if (strcmp(kursus[i].kode,"of1")==0||strcmp(kursus[i].kode,"OF1")==0)
 {
 strcpy(kursus[i].materi,"Office      ");
 kursus[i].biaya=350000;
 }

else if (strcmp(kursus[i].kode,"ph1")==0||strcmp(kursus[i].kode,"PH1")==0)
 {
 strcpy(kursus[i].materi,"Photoshop   ");
 kursus[i].biaya=550000;
 }

else if (strcmp(kursus[i].kode,"vb1")==0||strcmp(kursus[i].kode,"VB1")==0)
 {
 strcpy(kursus[i].materi,"Visual Basic");
 kursus[i].biaya=575000;
 }

else
 {
 strcpy(kursus[i].materi,"Salah Kode  ");
 kursus[i].biaya=0;
 }

total=total+kursus[i].biaya;
}
cout<<endl;
cout<<"HASIL"<<endl;
cout<<"Nama Siswa : "<<nama<< "      NIM : "<<nim<<endl;

cout<<"______________________________________________________"<<endl;

cout<<"No.      Materi Kursus      Biaya"<<endl;
for(i=1;i<=j;i++)
 {
 cout<<setiosflags(ios::left)<<setw(5)<<i;
 cout<<setprecision(4)<<"     "<<kursus[i].materi;
 cout<<setprecision(4)<<"      "<<kursus[i].biaya<<endl;
 }
cout<<"______________________________________________________"<<endl;
cout<<endl;

cout<<"Jumlah Total Bayar     =Rp."<<total<<endl;

cout<<"Mau Input Lagi [Y/T]???= ";cin>>lagi;
if (lagi== 'y' || lagi =='Y')
goto awal;
else

getch();
}

Terima Kasih, Semoga Bermanfaat :)

3 comments

Author
avatar
Balas
Author
avatar

makasi gan sangat membantu :v

Balas
Author
avatar
Balas

Komen dong