Selasa, 30 November 2010

OOP_Nama Hari

#include <stdio.h>
#include <conio.h>
#include <iostream.h>
#include <ctype.h>
char input;
main()
{
clrscr ();

cout << "PROGRAM MENENTUKAN NAMA HARI" << endl; cout << "Pilihan\n"; cout << "A=SENIN\n B=SELASA\n C=RABU\n D=KAMIS\n E=JUMAT\n F=SABTU\n G=AHAD\n"; cout << "Masukkan Kode Hari (A..G): ";cin >> input;endl;

if (toupper(input)=='A'){
cout<<"SENIN";
}
else if (toupper(input)=='B'){
cout<<"SELASA";
}
else if(toupper(input)=='C'){
cout<<"RABU";
}
else if (toupper(input)=='D'){
cout<<"KAMIS";
}
else if (toupper(input)=='E'){
cout<<"JUMAT";
}
else if (toupper(input)=='F') {
cout<<"SABTU";
}
else if(toupper (input)=='G'){
cout<<"AHAD";
}

else {
cout<<"MAAF KODE HARINYA SALAH";
}
getch();
}

Tidak ada komentar:

Posting Komentar