Advertisement
rony-Rony_05

Untitled

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