/*filename = Program Array Dimensi Satu */
/*Oleh : fk_seven */
/*Date : 14 Agustus 2011 */
#include "stdio.h"
#include "conio.h"
#include "string.h"
main()
{
char jurusan[25],jenjang[15],nim[10],nama[20];
clrscr();
cout<<"Masukkan nama Anda : "); gets(nama);
cout<<"Masukkan NIM Anda [10 digit] : "); gets(nim);
if(nim[1] == '1')
{strcpy(jenjang,"Strata-1");
switch(nim[0])
{ case '1' : strcpy(jurusan,"Teknik Informatika");
break;
case '2' : strcpy(jurusan,"Sistem Informasi");
break;
case '3' : strcpy(jurusan,"Teknik Komputer");
break;
case '4' : strcpy(jurusan,"Komputerisasi Akuntansi");
break;
default : strcpy(jurusan,"NIM anda salah");
break;
}}
else if(nim[1] == '3')
{strcpy(jenjang,"Diploma-3");
switch(nim[0])
{ case '1' : strcpy(jurusan,"Teknik Informatika");
break;
case '2' : strcpy(jurusan,"Sistem Informasi");
break;
case '3' : strcpy(jurusan,"Teknik Komputer");
break;
case '4' : strcpy(jurusan,"Komputerisasi Akuntansi");
break;
default : strcpy(jurusan,"NIM anda salah");
break;
}}
else
{strcpy(jurusan,"NIM anda salah");
strcpy(jenjang,"NIM anda salah");}
cout<<"\nData Mahasiswa Universitas Budi Luhur";
cout<<"====================================="<<endl<<endl;
cout<<"Nama : %s\n",nama);
cout<<"NIM : %s\n",nim);
cout<<"Jurusan : %s\n",jurusan);
cout<<"Jenjang : %s\n",jenjang);
getch();
}
0 komentar:
Posting Komentar