#include<iostream.h>
#include<conio.h>
struct mahasiswa
{
char nim[20];
char nama[30];
char alamat[50];
float tugas;
float quis;
float uts;
float uas;
float nilai_akhir;
};
void main()
{
mahasiswa mhs;
int i,tugas,quis,uts,uas,nilai_akhir;
cout<<"NIM : "; cin.getline(mhs.nim,20);
cout<<"Nama : "; cin.getline(mhs.nama,30);
cout<<"Alamat : "; cin.getline(mhs.alamat,50);
cout<<"tugas : "; cin>>mhs.tugas;
cout<<"quis : "; cin>>mhs.quis;
cout<<"uts : "; cin>>mhs.uts;
cout<<"uas : "; cin>>mhs.uas;
tugas=mhs.tugas*10/100;
quis=mhs.quis*15/100;
uts=mhs.uts*20/100;
uas=mhs.uas*35/100;
nilai_akhir=tugas+quis+uts+uas;
cout<<endl;
cout<<"Nim mhs : "<<mhs.nim<<endl;
cout<<"Nama mhs : "<<mhs.nama<<endl;
cout<<"Alamat mhs : "<<mhs.alamat<<endl;
cout<<"tugas mhs : "<<tugas<<endl;
cout<<"quis mhs : "<<quis<<endl;
cout<<"uts mhs : "<<uts<<endl;
cout<<"uas mhs : "<<uas<<endl;
cout<<"nilai akhir : "<<nilai_akhir;
getch();
}
#include<conio.h>
struct mahasiswa
{
char nim[20];
char nama[30];
char alamat[50];
float tugas;
float quis;
float uts;
float uas;
float nilai_akhir;
};
void main()
{
mahasiswa mhs;
int i,tugas,quis,uts,uas,nilai_akhir;
cout<<"NIM : "; cin.getline(mhs.nim,20);
cout<<"Nama : "; cin.getline(mhs.nama,30);
cout<<"Alamat : "; cin.getline(mhs.alamat,50);
cout<<"tugas : "; cin>>mhs.tugas;
cout<<"quis : "; cin>>mhs.quis;
cout<<"uts : "; cin>>mhs.uts;
cout<<"uas : "; cin>>mhs.uas;
tugas=mhs.tugas*10/100;
quis=mhs.quis*15/100;
uts=mhs.uts*20/100;
uas=mhs.uas*35/100;
nilai_akhir=tugas+quis+uts+uas;
cout<<endl;
cout<<"Nim mhs : "<<mhs.nim<<endl;
cout<<"Nama mhs : "<<mhs.nama<<endl;
cout<<"Alamat mhs : "<<mhs.alamat<<endl;
cout<<"tugas mhs : "<<tugas<<endl;
cout<<"quis mhs : "<<quis<<endl;
cout<<"uts mhs : "<<uts<<endl;
cout<<"uas mhs : "<<uas<<endl;
cout<<"nilai akhir : "<<nilai_akhir;
getch();
}
0 comments:
Post a Comment
Komentar sobat akan saya hapus jika:
- Mengandung unsur SPAM
- LINK hidup
- tidak sesuai dengan topik
NB:
jika ingin menyisipkan LINK ,silahkan pilih Name/URL pada option profil !