SOAL :
Data ke-1
NIM :
NAMA :
KELAS :
NILAI 1 :
NILAI 2 :
NA :
Data ke-2
NIM :
NAMA :
KELAS :
NILAI 1 :
NILAI 2 :
NA :
DATA NILAI MAHASISWA BSI
===============================================================
No. NIM NAMA KELAS NILAI 1 NILAI 2 NA KET
1.
2.
===============================================================
MAKA LISTING SCRIPT PROGRAM YANG AKAN KITA BUAT ADALAH SEBAGAI BERIKUT :
#include <conio.h>
#include <iostream.h>
#include <iomanip.h>
#include <stdio.h>
main()
{
char nama[20][10],nim[8][10],kelas[10][10],*ket[10];
int i,q;
float n1[10],n2[10],na[10];
cout<<" DATA NILAI MAHASISWA BSI "<<endl;
cout<<" =========================== "<<endl;
cout<<" masukkan jumlah mahasiswa = ";cin>>q;
for (i=1;i<=q;i++)
{
cout<<" DATA KE - "<<i<<endl;
cout<<" NIM : ";cin>>nim[i];
cout<<" NAMA : ";cin>>nama[i];
cout<<" KELAS : ";cin>>kelas[i];
cout<<" NILAI 1 : ";cin>>n1[i];
cout<<" NILAI 2 : ";cin>>n2[i];
cout<<endl;
na[i]=(n1[i]+n2[i])/2;
if (na[i]>=65)
{
ket[i]= "lulus";
}
else
{
ket[i]= "tidak lulus";
}
}
clrscr();
cout<<" DATA NILAI MAHASISWA "<<endl;
cout<<"==========================================================================="<<endl;
cout<<"NO. NAMA NIM KELAS NILAI1 NILAI2 NA KET "<<endl;
cout<<"==========================================================================="<<endl;
for (i=1;i<=q;i++)
{
cout<<setiosflags (ios::left)<<setw(10)<<i;
cout<<setiosflags (ios::left)<<setw(10)<<nama[i];
cout<<setiosflags (ios::left)<<setw(10)<<nim[i];
cout<<setiosflags (ios::left)<<setw(10)<<kelas[i];
cout<<setiosflags (ios::left)<<setw(10)<<n1[i];
cout<<setiosflags (ios::left)<<setw(10)<<n2[i];
cout<<setiosflags (ios::left)<<setw(10)<<na[i];
cout<<setiosflags (ios::left)<<setw(10)<<ket[i];
}
cout<<"==========================================================================="<<endl;
cout<<endl;
cout<<" ^=^=^=^=^=^ TERIMA KASIH ^=^=^=^=^=^ "<<endl;
getch();
}
#include <iostream.h>
#include <iomanip.h>
#include <stdio.h>
main()
{
char nama[20][10],nim[8][10],kelas[10][10],*ket[10];
int i,q;
float n1[10],n2[10],na[10];
cout<<" DATA NILAI MAHASISWA BSI "<<endl;
cout<<" =========================== "<<endl;
cout<<" masukkan jumlah mahasiswa = ";cin>>q;
for (i=1;i<=q;i++)
{
cout<<" DATA KE - "<<i<<endl;
cout<<" NIM : ";cin>>nim[i];
cout<<" NAMA : ";cin>>nama[i];
cout<<" KELAS : ";cin>>kelas[i];
cout<<" NILAI 1 : ";cin>>n1[i];
cout<<" NILAI 2 : ";cin>>n2[i];
cout<<endl;
na[i]=(n1[i]+n2[i])/2;
if (na[i]>=65)
{
ket[i]= "lulus";
}
else
{
ket[i]= "tidak lulus";
}
}
clrscr();
cout<<" DATA NILAI MAHASISWA "<<endl;
cout<<"==========================================================================="<<endl;
cout<<"NO. NAMA NIM KELAS NILAI1 NILAI2 NA KET "<<endl;
cout<<"==========================================================================="<<endl;
for (i=1;i<=q;i++)
{
cout<<setiosflags (ios::left)<<setw(10)<<i;
cout<<setiosflags (ios::left)<<setw(10)<<nama[i];
cout<<setiosflags (ios::left)<<setw(10)<<nim[i];
cout<<setiosflags (ios::left)<<setw(10)<<kelas[i];
cout<<setiosflags (ios::left)<<setw(10)<<n1[i];
cout<<setiosflags (ios::left)<<setw(10)<<n2[i];
cout<<setiosflags (ios::left)<<setw(10)<<na[i];
cout<<setiosflags (ios::left)<<setw(10)<<ket[i];
}
cout<<"==========================================================================="<<endl;
cout<<endl;
cout<<" ^=^=^=^=^=^ TERIMA KASIH ^=^=^=^=^=^ "<<endl;
getch();
}
HASILNYA :
SAAT PENGINPUTAN
SETELAH PENGINPUTAN
Atau Anda Dapat Mendownloadnya Pada Link Di Bawah Ini :
http://www.4shared.com/file/V56Usy66/tugas_7_teguh_11110247.html
This entry was posted
on 13.30
.
You can leave a response
and follow any responses to this entry through the
Langganan:
Posting Komentar (Atom)
.
0 komentar