Advertisement
oke_google

Untitled

Feb 20th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <stdio.h>
  4. using namespace std;
  5. int main() {
  6.  
  7. long npm [20];
  8. char nama[20][20];
  9. char alamat [50][50];
  10. int total[100];
  11. int no = 2 ;
  12.  
  13. for (int i=1;i<=no;i++){
  14. cout<<"masukkan npm mahasiswa: "; cin>>npm[i];
  15. cin.ignore();
  16. cout<<"masukkan nama mahasiswa: ";gets(nama[i]);
  17. cout<<"masukkan alamat mahasiswa: ";gets (alamat[i]);
  18. cout<<"masukkan nilai mahasiswa: ";
  19. cin>>total[i];
  20. cout<<endl;
  21. }
  22.  
  23. cout<<endl;
  24. cout<<"tampilkan data"<<endl;
  25.  
  26. for (int a=1;a<=no;a++){
  27.  
  28. cout<<"npm: "<<npm[a]<<endl;
  29. cout<<"masukkan nama mahasiswa: "<<nama[a]<<endl;
  30. cout<<"Alamat mahasiswa :"<<alamat[a]<<endl;
  31. cout<<"nilai angka : "<<total[a]<<endl;
  32. cout<<"nilai huruf = ";
  33.  
  34. if (total[a]>=80.56&&total[a]<=100){
  35.  
  36. cout<<" A ";}
  37.  
  38. else if (total[a]>=70.56&&total[a]<=80.55){
  39.  
  40. cout<<" B ";}
  41.  
  42. else if (total[a]>=65.56&&total[a]<=70.55){
  43.  
  44. cout<<" C ";}
  45.  
  46. else if (total[a]>=55.56&&total[a]<=65.55){
  47.  
  48. cout<<" D ";}
  49.  
  50. else{
  51.  
  52. cout<<" E ";}
  53.  
  54. cout<<endl;
  55. }
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement