SAADQUAMER

Project

Aug 3rd, 2019
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.31 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. void showall(){
  4. printf("\n\n<<<<<Money Conversion Rate>>>>>\n\n");
  5. printf("1.  1 Rupee         = 1.21 BDT\n");
  6. printf("2.  1 British Pound = 102.43 BDT\n");
  7. printf("3.  1 Dirham        = 23.41 BDT\n");
  8. printf("4.  1 Canadian      = 63.86 BDT\n");
  9. printf("5.  1 Euro          = 94.03 BDT\n");
  10. printf("6.  1 Thai bhat     = 2.76 BDT\n");
  11. printf("7.  1 Swiss France  = 86.02 BDT\n");
  12. printf("8.  1 Aust Dollar   = 57.47 BDT\n");
  13. printf("9.  1 Usd           = 84.49 BDT\n");
  14. printf("10. 1 Krona         = 8.77 BDT\n");
  15. printf("11. 1 turkey        = 15.20 BDT\n");
  16. Menu();
  17. }
  18. void convert (){
  19. float  indian=1.21,british=102.43,dirham=23.41,canadian=63.86,euros=94.03,thailand=2.76,swizerland=86.02,australia=57.47,
  20. usd=84.49,sweden=8.77,turkey=15.20;
  21. float bdt;
  22. int x,amount,choice,i;
  23.  
  24.  
  25. printf("\n\t<<<<<<< Currency Conversion Process >>>>>>>>\n\n");
  26. printf("\t1)   India Rupee          \n");
  27. printf("\t2)   British Pound         \n");
  28. printf("\t3)   Dirham             \n");
  29. printf("\t4)   Canadian Dollar           \n");
  30. printf("\t5)   Euro                      \n");
  31. printf("\t6)   Thai bhat       \n");
  32. printf("\t7)   Swiss France        \n");
  33. printf("\t8)   Australian Dollar         \n");
  34. printf("\t9)   Usd            \n");
  35. printf("\t10)  Krona           \n");
  36. printf("\t11)  Lira                     \n");
  37. printf("\t12)  Exit the Program          \n\n");
  38.  
  39. printf("   \nPlease enter your choice (1-12): ");
  40. while(scanf("%d",&choice)!=EOF){
  41.  
  42. {
  43. if(choice>=1 &&choice<=11){
  44. printf("Please enter your Amount: ");
  45. scanf("%d",&amount);}
  46.  
  47. }
  48.  
  49.  
  50. if(choice==1){
  51.     bdt=indian*amount;
  52.     printf("Rupee to BDT :%.2f\n",bdt);
  53. }
  54. else if(choice==2){
  55.     bdt=british*amount;
  56.     printf("British Pound To BDT  :%.2f\n",bdt);
  57. }
  58. else if(choice==3){
  59.     bdt=dirham*amount;
  60.     printf("Dirham To BDT  :%.2f\n",bdt);
  61. }
  62. else if(choice==4){
  63.     bdt=canadian*amount;
  64.     printf("Canadiaan Dollar To BDT  :%.2f\n",bdt);
  65. }
  66. else if(choice==5){
  67.     bdt=euros*amount;
  68.     printf("Euro To BDT :%.2f\n",bdt);
  69. }
  70. else if(choice==6){
  71.     bdt=thailand*amount;
  72.     printf("Thai Bhatt To BDT :%.2f\n",bdt);
  73.  
  74. }
  75. else if(choice==7){
  76.     bdt=swizerland*amount;
  77.     printf("Swiss France TO BDT :%.2f\n",bdt);
  78. }
  79. else if(choice==8){
  80.     bdt=australia*amount;
  81.     printf("Australian Dollar TO BDT  :%.2f\n",bdt);
  82. }
  83. else if(choice==9){
  84.     bdt=usd*amount;
  85.     printf("US Dollar To BDT :%.2f\n",bdt);
  86. }
  87. else if(choice==10){
  88.     bdt=sweden*amount;
  89.     printf(" Krona TO BDT :%.2f\n",bdt);
  90. }
  91. else if(choice==11){
  92.     bdt=turkey*amount;
  93.     printf("Lira TO BDT :%.2f\n",bdt);
  94. }
  95. else if(choice==12){
  96.  
  97.     printf("Exit The Program\n");
  98.     Menu();
  99. }
  100. else {printf("Invalid Input!!\n");
  101.  
  102. }
  103. printf("\nPlease enter your choice (1-12): ");}
  104.  
  105.  
  106. }
  107. struct currency
  108. {
  109.     char country[50];
  110.     float rate;
  111. };
  112.  
  113. void addcounty()
  114. {
  115.     int i,j;
  116.     printf("\n\t<<<<<Adding Country Information>>>>>\n");
  117.     printf("\n\tEnter Total Input Numbers :");
  118.     scanf("%d",&j);
  119.  
  120.     struct currency rt;
  121.     for(i=1;i<=j;i++){
  122.     printf("\n\t %d.Enter Country Name:",i);
  123.     scanf("%s",&rt.country);
  124.     printf("\t %d.Enter Country Rate:",i);
  125.     scanf("%f",&rt.rate);
  126.     printf("\n\t%d %s, rate= %.2f\n",i,rt.country,rt.rate);
  127.     }
  128.  
  129.  
  130.  
  131. }
  132. void Menu()
  133. {
  134.     int choice;
  135.  
  136.     printf("\n\t<<<<<<<<Currency Conversion Program>>>>>>>>>>>>\n\n");
  137.  
  138.     printf("\t  <<<<<<<<Welcome To Main Menu>>>>>>>>>>>\n\n");
  139.     printf("\t  1) Currency Conversion\n");
  140.     printf("\t  2) Search Country\n");
  141.     printf("\t  3) Add Country Information\n");
  142.     printf("\t  4) Edit Country Information\n");
  143.     printf("\t  5) Show Currency Details\n");
  144.     printf("\t  6) Exit\n");
  145.  
  146.     printf("\n\t Enter Your Choice (1-6):");
  147.  
  148.     scanf("%d",&choice);
  149.  
  150.     switch(choice)
  151.     {
  152.  
  153.     case 1:
  154.         convert();
  155.         break;
  156.         Menu();
  157.     case 2:
  158.         printf("YOU Entered Two");
  159.         break;
  160.     case 3:
  161.         addcounty();
  162.         break;
  163.     case 4:
  164.         printf("YOU Entered Four");
  165.         break;
  166.     case 5:
  167.         showall();
  168.         break;
  169.     case 6:
  170.         printf("\t<<<<Exit From Currency Convert Process>>>>\n");
  171.         break;
  172.  
  173.     default:
  174.         printf("\n\tInvalid Input!!\n\n");
  175.         Menu();
  176.     }
  177.  
  178.  
  179.  
  180.  
  181. }
  182. int main()
  183. {
  184.     Menu();
  185.     return 0;
  186. }
Advertisement
Add Comment
Please, Sign In to add comment