--

Review Abstract Data Type (OOP)

Tuesday, April 17, 2012 mencoba sebuah karya dunia maya
#include
#include

constream ctk;

struct mahasiswa { char nim[11]; char nama[21];
};

void main(){
ctk.clrscr();

struct mahasiswa a;
do{
ctk << “Masukkan NIM [10 digit]: “; cin >> a.nim;
}while(strlen(a.nim)!=10);

do{
ctk << “Masukkan Nama [max 20 digit]: “; cin >> a.nama;
}while(strlen(a.nama)==0||strlen(a.nama)>20);


ctk << endl << endl;
ctk << “NIM : “ << a.nim << “ Nama : “ << a.nama;

getch();
}

0 komentar: Review Abstract Data Type (OOP)

Post a Comment