Program Biodata dengan Perulangan “For”
Page 1 of 1 • Share •
Program Biodata dengan Perulangan “For”
#include
#include
#include
main ()
{
char a[30],b[10],c[20],d[5];
float e;
for (int x=0;x<5;x++)
{
cout<<"\n\n Masukkan nama mahasiswa : ";
gets(a);
cout<<"\n NIM : ";
cin>>b;
cout<<"\n Masukkan asal sekolah : ";
gets(c);
cout<<"\n Masukkan jurusan : ";
cin>>d;
cout<<"\n Masukkan nilai UAN : ";
cin>>e;
cout<<"\n Nama Mahasiswa : "<cout<<"\n NIM : "<cout<<"\n Asal Sekolah : "< cout<<"\n Jurusan : "< cout<<"\n Nilai UAN : "<
if (e<6)
{
cout<<"\n Silakan Anda mengikuti TES TERTULIS.";
}
else if (6<=e && e<7)
{
cout<<"\n Selamat Anda mendapatkan beasiswa sebesar Rp 1.300.000,-";
}
else if (7<=e && e<=
{
cout<<"\n Selamat Anda mendapatkan beasiswa sebesar Rp 1.500.000,-";
}
else
{
cout<<"\n Selamat Anda mendapatkan beasiswa sebesar Rp 2.000.000,-";
}
}
getch();
}
#include
#include
main ()
{
char a[30],b[10],c[20],d[5];
float e;
for (int x=0;x<5;x++)
{
cout<<"\n\n Masukkan nama mahasiswa : ";
gets(a);
cout<<"\n NIM : ";
cin>>b;
cout<<"\n Masukkan asal sekolah : ";
gets(c);
cout<<"\n Masukkan jurusan : ";
cin>>d;
cout<<"\n Masukkan nilai UAN : ";
cin>>e;
cout<<"\n Nama Mahasiswa : "<cout<<"\n NIM : "<cout<<"\n Asal Sekolah : "<
if (e<6)
{
cout<<"\n Silakan Anda mengikuti TES TERTULIS.";
}
else if (6<=e && e<7)
{
cout<<"\n Selamat Anda mendapatkan beasiswa sebesar Rp 1.300.000,-";
}
else if (7<=e && e<=
{
cout<<"\n Selamat Anda mendapatkan beasiswa sebesar Rp 1.500.000,-";
}
else
{
cout<<"\n Selamat Anda mendapatkan beasiswa sebesar Rp 2.000.000,-";
}
}
getch();
}

Admin- Admin
- Posts: 23
Join date: 2009-11-07
Age: 19
Location: Yogyakarta, Indonesia

Re: Program Biodata dengan Perulangan “For”
Untuk tulisan yang berisi source code program, sebaiknya dimasukkan ke dalam tag code (diapit dengan [ code] dan [ /code]) seperti contoh berikut ini.
Semoga bisa membantu.
- Code:
#include <conio>
#include <iostream>
#include <stdio>
main ()
{
char a[30],b[10],c[20],d[5];
float e;
for (int x=0;x<5;x++)
{
cout<<"\n\n Masukkan nama mahasiswa : ";
gets(a);
cout<<"\n NIM : ";
cin>>b;
cout<<"\n Masukkan asal sekolah : ";
gets(c);
cout<<"\n Masukkan jurusan : ";
cin>>d;
cout<<"\n Masukkan nilai UAN : ";
cin>>e;
cout<<"\n Nama Mahasiswa : "<<a;
cout<<"\n NIM : "<<b;
cout<<"\n Asal Sekolah : "<<c;
cout<<"\n Jurusan : "<<d;
cout<<"\n Nilai UAN : "<<e<<"\n";
if (e<6)
{
cout<<"\n Silakan Anda mengikuti TES TERTULIS.";
}
else if (6<=e && e<7)
{
cout<<"\n Selamat Anda mendapatkan beasiswa sebesar Rp 1.300.000,-";
}
else if (7<=e && e<=8)
{
cout<<"\n Selamat Anda mendapatkan beasiswa sebesar Rp 1.500.000,-";
}
else
{
cout<<"\n Selamat Anda mendapatkan beasiswa sebesar Rp 2.000.000,-";
}
}
getch();
}
Semoga bisa membantu.
ys- Posts: 2
Join date: 2009-11-26
Re: Program Biodata dengan Perulangan “For”
hohoho,...btw thanks bwt sarannya...,,
waktu itu lom liad ad panel kode begituan..
....brb bljr buat ujian besok..

waktu itu lom liad ad panel kode begituan..

Admin- Admin
- Posts: 23
Join date: 2009-11-07
Age: 19
Location: Yogyakarta, Indonesia

Permissions of this forum:
You cannot reply to topics in this forum
AMIKOM


