Subscribe
Add to Technorati Favourites
Add to del.icio.us
Sabtu, Oktober 04, 2008

Megkonversi nilai angka menjadi huruf

Diposting oleh prana-uad

Program Megkonversi nilai angka menjadi huruf


#include
#include
#include

///////////////////////////////////////////////////////////////
////////Prana Andypal (http://prana-uad.blogspot.com)////////
//////////// Program untuk mengkonversi nilai angka menjadi huruf////////////
/////////////////////////////////////////////////////////////

int main(){
HANDLE hConsole;
hConsole=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsole,11);
cout<for(int i=0; i<78; i++){
cout<}
cout<for(int j=2; j<=4; j++){
gotoxy(1,j);
cout<gotoxy(80,j);
cout<}
gotoxy(1,5);
cout<for( int i=1; i<=78; i++){
cout<}
cout<
//==================atas kiri==================
for(int j=2; j<=5; j++){
gotoxy(14,j);
cout<}
gotoxy(1,1);
cout<for(int i=1; i<=12; i++){
cout<}
cout<cout << endl;
gotoxy(1,5);
cout<for( int i=1; i<=12; i++){
cout<}
cout<//=================atas kanan==================
for(int j=2; j<=5; j++){
gotoxy(67,j);
cout<}
gotoxy(67,1);
cout<for(int i=1; i<=12; i++){
cout<}
cout<cout << endl;
gotoxy(67,5);
cout<for( int i=1; i<=12; i++){
cout<}
cout<//==================kiri simbol laki============
SetConsoleTextAttribute(hConsole,543);
gotoxy(15,2);
for(int i=1; i<=5; i++){
cout<}
gotoxy(15,3);
for(int i=1; i<=5; i++){
cout<}
gotoxy(15,4);
for(int i=1; i<=5; i++){
cout<}
//==================kanan simbol cewek==========
gotoxy(62,2);
for(int i=1; i<=5; i++){
cout<}
gotoxy(62,3);
for(int i=1; i<=5; i++){
cout<}
gotoxy(62,4);
for(int i=1; i<=5; i++){
cout<}
//========================================
SetConsoleTextAttribute(hConsole,87);
gotoxy(20,2);
cout<for(int i=1; i<=40; i++){
cout<}
cout<cout << endl;
gotoxy(20,3);
cout << char (186);
textcolor(14);
cprintf( " http://prana-uad.blogspot.com " );
cout << char (186);
gotoxy(21,3);
cout<gotoxy(60,3);
cout<gotoxy(20,4);
cout<for( int i=1; i<=40; i++){
cout<}
cout<//================arsiran kanan dan kiri========
SetConsoleTextAttribute(hConsole,51);
gotoxy(2,2);
cout<for(int i=1; i<=11; i++){
cout<}
gotoxy(2,3);
cout<for(int i=1; i<=11; i++){
cout<}
gotoxy(2,4);
cout<for(int i=1; i<=11; i++){
cout<}
gotoxy(68,2);
cout<for(int i=1; i<=11; i++){
cout<}
gotoxy(68,3);
cout<for(int i=1; i<=11; i++){
cout<}
gotoxy(68,4);
cout<for(int i=1; i<=11; i++){
cout<}
//////////////////////////////////////////////////
SetConsoleTextAttribute(hConsole,123);
gotoxy(1,6);
cout<for(int i=1; i<=79; i++){
cout<}
////////////////////////////////////////////////
SetConsoleTextAttribute(hConsole,10);
int n;
cout<<"\nProgram untuk mengetahui nilai ujian " ;
SetConsoleTextAttribute(hConsole,13);
cout<<"\n\nMasukkan nilai ujian anda? " ;
cin>> n;
if (n>100){
SetConsoleTextAttribute(hConsole,13);
cout<< "\nSalah, nilai diluar jangkauan"<}
else if (n<0){
cout<< "Salah, nilai diluar jangkauan"<}
else {
switch (n/10) {
case 9 : cout<<" Nilai = A"; break;
case 8 : cout<<" Nilai = B"; break;
case 7 : cout<<" Nilai = C"; break;
case 6 : cout<<" Nilai = D"; break;
case 5 : cout<<" Nilai = E"; break;
default : cout<<" Nilai = F"; break;
}
}
getch();
return 0;
}


0 komentar: