Thursday, May 24, 2018

CONTOH CODING C++ INPUTAN DATA MAHASISWA

#include <conio.h>
#include <stdio.h>
#include <stdio.h>
#include <iomanip.h>

main()
{
    char npm [2][10];
   char nama [2][20];
   char kode [2][2][10];
   char matkul [2][2][10];
   int sks [2][2];
   int total_sks=0;
   int x,y;
   cout<<"DAFTAR PENGAMBILAN MATA KULIAH\n\n";
   x=0;
   while (x<2)
   {
       cout<<"DATA MAHASISWA - "<<(x+1)<<endl;
      cout<<"NPM  : ";gets (npm[x]);
      cout<<"NAMA : ";gets (nama[x]);
      y=0;
      while (y<2)
      {
         cout<<"DATA MATAKULIAH - "<<(x+1)<<endl;
          cout<<"KODE MATAKULIAH : ";gets (kode[x][y]);
         cout<<"NAMA MATAKULIAH : ";gets (matkul[x][y]);
         cout<<"SKS             : ";cin>>sks[x][y];
         y=y+1;
         }
         cout<<endl;
         x=x+1;
         }
         clrscr();
         cout<<"DAFTAR PENGAMBILAN MATA KULIAH\n\n";
         x=0;
         while (x<2)
         {
            clrscr();
             cout<<"DATA MAHASISWA - "<<(x+1)<<endl;
             cout<<"NPM  : "<<npm[x]<<endl;
             cout<<"NAMA : "<<nama[x]<<endl;
             cout<<"______________________________________\n";
             cout<<"NO.       KODE        NAMA        SKS \n";
             cout<<"          MATAKULIAH  MATAKULIAH      \n";
             cout<<"______________________________________\n";
            y=0;
            while (y<2)
            {
               cout<<setw (3)<<(x+1)
                   <<setw (14)<<kode[x][y]
                   <<setw (14)<<matkul[x][y]
                   <<setw (5)<<sks[x][y]<<endl;
               total_sks=total_sks+sks[x][y];
               y=y+1;
               }
              cout<<"______________________________________\n";
              cout<<"TOTAL SKS : "<<total_sks<<endl;
              getch();
              x=x+1;
            }
}

No comments:

Post a Comment

CONTOH CODING LINKED LIST MENGGUNAKAN BORLAND C++

CONTOH CODING LINKED LIST MENGGUNAKAN BORLAND C++ #include<stdlib.h> #include<conio.h> #include<iostream.h> struc...