Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <stdio.h>
- using namespace std;
- int main() {
- long npm [20];
- char nama[20][20];
- char alamat [50][50];
- int total[100];
- int no = 2 ;
- for (int i=1;i<=no;i++){
- cout<<"masukkan npm mahasiswa: "; cin>>npm[i];
- cin.ignore();
- cout<<"masukkan nama mahasiswa: ";gets(nama[i]);
- cout<<"masukkan alamat mahasiswa: ";gets (alamat[i]);
- cout<<"masukkan nilai mahasiswa: ";
- cin>>total[i];
- cout<<endl;
- }
- cout<<endl;
- cout<<"tampilkan data"<<endl;
- for (int a=1;a<=no;a++){
- cout<<"npm: "<<npm[a]<<endl;
- cout<<"masukkan nama mahasiswa: "<<nama[a]<<endl;
- cout<<"Alamat mahasiswa :"<<alamat[a]<<endl;
- cout<<"nilai angka : "<<total[a]<<endl;
- cout<<"nilai huruf = ";
- if (total[a]>=80.56&&total[a]<=100){
- cout<<" A ";}
- else if (total[a]>=70.56&&total[a]<=80.55){
- cout<<" B ";}
- else if (total[a]>=65.56&&total[a]<=70.55){
- cout<<" C ";}
- else if (total[a]>=55.56&&total[a]<=65.55){
- cout<<" D ";}
- else{
- cout<<" E ";}
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement