EXCHANGE MONEY
หน้าต่างโปรแกรม Exchange Money
กรอกชื่อประเทศที่ลูกค้าต้องการแปลงค่าสกุลเงิน โดยมีประเทศดังต่อไปนี้
1.USA , 2.UK , 3.JAPAN , 4.LAOS , 5.CHINA , 6.EURO ZONE and 7.KOREA
ตัวอย่างการแปลงสกุลเงิน
จำนวนเงินที่ต้องการแปลง : 1000 บาทประเทศเกาหลีที่เลือก : เกาหลี
ผลลัพธ์จากการแปลงค่าเงิน : 33060 วอน
หากต้องการเปรียบเทียบสกุลเงินของแต่ประเทศ หรือต้องการป้อนหลายครั้ง
โปรแกรมของ Exchange Moneyก็สามารถทำซ้ำได้
CODE
#include<stdio.h>
#include<conio.h>
main()
{
float baht,a,u,j,l,c,k,Money;
char cur ;
int counter;
for (counter=1;counter<=7;counter++)
{
printf("\t\tExchange Money\n- - - - - - - - - - - - - - - - - - - - - - - - - \n");
printf("Enter your money of Thailand (THB) :");
scanf("%f",&baht);
printf("\nPress choose enter Countries that want to convert money!\n");
printf("Press a for United States of America \nPress u for United Kingdom \nPress j for Japan \nPress l for Laos \nPress c for China\nPress e for Euro Zone\npress k for Korea\n :");
scanf("%c",&cur);
cur=getchar();
if ((cur=='a')||(cur=='A')){
Money = baht * 0.0281 ;
printf("Money of United States of America = %.3f (USD) \n\n***************************************************\n\n",Money);}
else if((cur=='u')||(cur=='U')){
Money = baht * 0.0226 ;
printf("Money of United Kingdom = %.3f (GBP) \n\n***************************************************\n\n",Money);}
else if((cur=='j')||(cur=='J')){
Money = baht * 3.18 ;
printf("Money of Japan = %.3f (JPY) \n\n***************************************************\n\n",Money);}
else if((cur=='l')||(cur=='L')){
Money = baht * 230.52 ;
printf("Money of Laos = %.3f (LAK) \n\n***************************************************\n\n",Money);}
else if((cur=='c')||(cur=='C')){
Money = baht * 0.19 ;
printf("Money of China = %.3f (CNY) \n\n***************************************************\n\n",Money);}
else if((cur=='e')||(cur=='E')){
Money = baht * 0.0265 ;
printf("Money of Euro Zone = %.3f (EUR) \n\n***************************************************\n\n",Money);}
else if((cur=='k')||(cur=='K')){
Money = baht * 33.06 ;
printf("Money of Korea = %.3f (KRW) \n\n***************************************************\n\n",Money);}
}
getch();
return 0;
}

ไม่มีความคิดเห็น:
แสดงความคิดเห็น