Advertisement
Guest User

project

a guest
Dec 11th, 2019
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.21 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int am=1000000;
  4. int print()
  5. {
  6.     long long int i,n;
  7.     for(i=0;i<100000000;i++)
  8.     {}cout<<"\t\t\t\t\t\tL";
  9.     for(i=0;i<100000000;i++)
  10.     {}cout<<"o";
  11. for(i=0;i<100000000;i++){}
  12. cout<<"a";
  13. for(i=0;i<100000000;i++){}
  14. cout<<"d";
  15. for(i=0;i<100000000;i++){}
  16. cout<<"i";
  17. for(i=0;i<100000000;i++){}
  18. cout<<"n";
  19. for(i=0;i<100000000;i++){}
  20. cout<<"g";
  21. for(i=0;i<100000000;i++){}
  22. cout<<".";
  23. for(i=0;i<100000000;i++){}
  24. cout<<".";
  25. for(i=0;i<100000000;i++){}
  26. cout<<".";
  27. for(i=0;i<100000000;i++){}
  28. for(i=0;i<100000000;i++){}
  29. for(i=0;i<100000000;i++){}
  30. for(i=0;i<100000000;i++){}
  31. for(i=0;i<100000000;i++){}
  32. for(i=0;i<100000000;i++){}
  33. for(i=0;i<100000000;i++){}
  34. for(i=0;i<100000000;i++){}
  35. for(i=0;i<100000000;i++){}
  36. for(i=0;i<100000000;i++){}
  37. for(i=0;i<100000000;i++){}
  38. for(i=0;i<100000000;i++){}
  39. for(i=0;i<100000000;i++){}
  40. for(i=0;i<100000000;i++){}
  41.  
  42. }
  43.  
  44.  
  45. void dp(int n)
  46. {
  47.     if(n>am)
  48.     {
  49.         cout<<endl<<endl;
  50.         print();
  51.         cout<<"\n\n\t\t\t\t\t\t!!!!!! Insufficient balance. !!!!!!"<<endl;
  52.         return ;
  53.     }
  54.     map<int,int> m;
  55.     map<int,int> :: iterator it;
  56.     int i,j,k;
  57.     int a[]={1,2,5,10,20,50,100,500,1000};
  58.  
  59.  
  60.     int t[10][n+1];
  61.     char x[10][n+1];
  62.  
  63.  
  64.  
  65.     for(i=0;i<10;i++)
  66.     {
  67.         t[i][0]=0;
  68.     }
  69.     for(i=1;i<=n;i++)
  70.     {
  71.         t[0][i]=1000000;
  72.     }
  73.  
  74.     for(i=1;i<=9;i++)
  75.     {
  76.         for(j=1;j<=n;j++)
  77.         {
  78.             if(a[i-1]>j)
  79.             {
  80.                 t[i][j]=t[i-1][j];
  81.                 x[i][j]='u';
  82.             }
  83.             else
  84.             {
  85.                 if(1+t[i][j-a[i-1]]<t[i-1][j])
  86.                 {
  87.                     t[i][j]=1+t[i][j-a[i-1]];
  88.                     x[i][j]='l';
  89.                 }
  90.                 else{
  91.                     t[i][j]=t[i-1][j];
  92.                 x[i][j]='u';
  93.                 }
  94.  
  95.             }
  96.  
  97.         }
  98.     }
  99.     cout<<endl<<endl<<" \t\t\t\t\t\tThe minimum number of note is: "<<t[9][n]<<endl;
  100.     cout<<endl<<" \t\t\t\t\t\tUsed Notes are : "<<endl;
  101.  
  102.     i=9;
  103.     j=n;
  104.     while(i>0&&j>0)
  105.     {
  106.         if(x[i][j]=='l')
  107.         {
  108.             m[a[i-1]]++;
  109.  
  110.             j-=a[i-1];
  111.         }
  112.         else{
  113.             i-=1;
  114.         }
  115.     }
  116.  
  117.     for(it=m.begin();it!=m.end();it++)
  118.     {
  119.         cout<<"\t\t\t\t\t\t"<<it->first<<" Taka Notes * "<<it->second<<endl;
  120.     }
  121. am-=n;
  122.  
  123.  
  124.  
  125. }
  126.  
  127. int convert()
  128. {
  129.     int x,y;
  130.     double a,tk;
  131.     printf("\n\n\t\t\t\t\t\tFor Dollar press 1.\n\t\t\t\t\t\tFor Euro press   2.\n\t\t\t\t\t\tFor riyal press  3.\n\t\t\t\t\t\tFor Pound press  4.\n\t\t\t\t\t\tFor Rupee press  5.\n");
  132.  
  133.     printf("\n\t\t\t\t\t\tPlease input your choice:");
  134.     scanf("%d",& x);
  135.     if(x==1)
  136.     {
  137.  
  138.  
  139.         printf("\n\t\t\t\t\t\tAmount of Dollar :");
  140.         scanf("%lf",&a);
  141.         tk=a*84.92;
  142.         printf("\n\n\t\t\t\t\t\t%0.2lf Dollar = %.0lf TK\n",a,tk);
  143.  
  144.     }
  145.     else if(x==2)
  146.     {
  147.  
  148.         printf("\n\t\t\t\t\t\tAmount of Euro :");
  149.         scanf("%lf",&a);
  150.         tk=a*94.05;
  151.         printf("\n\n\t\t\t\t\t\t%0.2lf Euro = %.0lf TK\n",a,tk);
  152.     }
  153.     else if(x==3)
  154.     {
  155.  
  156.         printf("\n\t\t\t\t\t\tAmount of Riyal :");
  157.         scanf("%lf",&a);
  158.         tk=a*22.64;
  159.         printf("\n\n\t\t\t\t\t\t%0.2lf Riyal = %.0lf TK\n",a,tk);
  160.     }
  161.     else if(x==4)
  162.     {
  163.  
  164.         printf("\n\t\t\t\t\t\tAmount of Pound :");
  165.         scanf("%lf",&a);
  166.         tk=a*112.01;
  167.         printf("\n\n\t\t\t\t\t\t%0.2lf pound = %.0f TK\n",a,tk);
  168.     }
  169.     else if(x==5)
  170.     {
  171.         printf("\n\t\t\t\t\t\tAmount of Rupee :");
  172.         scanf("%lf",&a);
  173.         tk=a*1.20;
  174.         printf("\n\n\t\t\t\t\t\t%0.2lf Rupee= %.0lf TK\n",a,tk);
  175.     }
  176.  
  177.     cout<<"\n\n\t\t\t\t\t\tDo You Want To Exchange Money: "<<endl<<"\t\t\t\t\t\t1.Yes"<<endl<<"\t\t\t\t\t\t2.No";
  178.     cout<<"\n\t\t\t\t\t\tEnter your Choice: ";
  179.     cin>>y;
  180.     if(y==1)
  181.     {
  182.         dp(tk);
  183.     }
  184.     else{
  185.         return tk;
  186.     }
  187. }
  188.  
  189.  
  190.  
  191. int main()
  192. {
  193.     string username;
  194.     string password;
  195.     char choice;char choice1;
  196.     int n,z;
  197.  
  198.     cout<<" \t\t\t\t\t\t--------------------                       "<<endl;
  199.     cout<<" \t\t\t\t\t\t| Please Log in First |                       "<<endl;
  200.     cout<<" \t\t\t\t\t\t--------------------                       "<<endl;
  201.  
  202.     cout<<" \t\t\t\t\t\t"<<""<<endl<<endl;
  203.  
  204.     while (password != "1")
  205.     {
  206.         cout << "\t\t\t\t\t\t"<<"Username : ";
  207.         getline(cin, username);
  208.  
  209.         if (username == "o")
  210.         {
  211.             cout << "\t\t\t\t\t\t"<<"Password : ";
  212.             getline(cin, password);
  213.         }
  214.  
  215.         if (password != "1")
  216.         {
  217.             cout <<endl<< "\t\t\t\t\t\t"<<"Wrong Input!!!!"<<endl;
  218.             cout << "\t\t\t\t\t\t"<<"\n";
  219.             cout << "\t\t\t\t\t\t"<<"@!!!!!!!!!!!!!!!!!!!!!!!@"<<endl;
  220.             cout << "\t\t\t\t\t\t"<<"      Access Denied!!    " << std::endl;
  221.             cout << "\t\t\t\t\t\t"<<"@!!!!!!!!!!!!!!!!!!!!!!!@"<<endl;
  222.             cout << "\t\t\t\t\t\t"<<"\n";
  223.          }
  224.  
  225.         else
  226.         {
  227.             cout << "\t\t\t\t\t\t"<<"\n";
  228.             cout << "\t\t\t\t\t\t"<<"@########################@"<<endl;
  229.             cout << "\t\t\t\t\t\t"<<"@^^^ Access Granted!! ^^^@"<<endl;
  230.             cout << "\t\t\t\t\t\t"<<"@########################@"<<endl;
  231.             cout << "\t\t\t\t\t\t"<<"\n";
  232.         }
  233.     }
  234.     while(1)
  235.     {
  236.         cout<<endl<<endl<<endl<<endl<<endl;
  237.     print();
  238.     cout<<endl<<endl<<endl;
  239.     cout<<" \t\t\t\t\t\t********MAIN MENU********\n"<<endl;
  240.  
  241.     cout<<" \t\t\t\t\t\t--------------------                       ----------------------"<<endl;
  242.     cout<<" \t\t\t\t\t\t| 1)MONEY EXCHANGE |                       | 3)CONVERTER RECORD |"<<endl;
  243.     cout<<" \t\t\t\t\t\t--------------------                       ----------------------\n\n"<<endl;
  244.  
  245.     cout<<" \t\t\t\t\t\t---------------                             ----------"<<endl;
  246.     cout<<" \t\t\t\t\t\t| 2)CONVERTER |                             | 4)EXIT |"<<endl;
  247.     cout<<" \t\t\t\t\t\t---------------                             ----------"<<endl;
  248.  
  249.     cout <<endl<<endl<< " \t\t\t\t\t\tPlease enter your choice : ";
  250.     cin >> choice;
  251.     cout << endl<<endl;
  252.     if(choice=='1')
  253.     {
  254.         cout<<" \t\t\t\t\t\t***Choose Currency***"<<endl<<endl;
  255.         cout<<"\t\t\t\t\t\tFor Taka press   1.\n\t\t\t\t\t\tFor Other press   2.\n";
  256.         cout <<endl<< "\t\t\t\t\t\tPlease input your choice : ";
  257.         cin>>choice1;
  258.         if(choice1=='1')
  259.         {
  260.             cout<<endl<<" \t\t\t\t\t\tEnter amount of Taka:";
  261.             cin>>n;
  262.             dp(n);
  263.         }
  264.         else
  265.         {
  266.             convert();
  267.         }
  268.     }
  269.      else if(choice=='2')
  270.     {
  271.         convert();
  272.     }
  273.     else if(choice=='3')
  274.     {
  275.         cout<< "\n\n\t\t\t\t\t\t!!!!! Not Yet Ready !!!!!"<<endl<<endl<<endl;
  276.     }
  277.     else if(choice=='4')
  278.     {
  279.         cout<< "\n\n\t\t\t\t\t\t##### Thank You..Bye #####"<<endl<<endl<<endl ;
  280.         return 0;
  281.     }
  282.  
  283.     cout<<"\n\n\n\t\t\t\t\t\tDo you want more Exchange: "<<endl;
  284.     cout<<"\t\t\t\t\t\t1.Yes"<<endl;
  285.     cout<<"\t\t\t\t\t\t2.No"<<endl;
  286.     cout<<"\t\t\t\t\t\tEnter your choice: ";
  287.     cin>>z;
  288.     if(z==2)
  289.     {
  290.         break;
  291.     }
  292.  
  293.     }
  294.  
  295.  
  296.  
  297. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement