Rainrix2001

Online Money Transfer

Aug 12th, 2019
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.64 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main () {
  6.     char trans1;
  7.     float aTransfer, tFee, sFee, rb, amt, tad;
  8.     string cn, pin, rpin, trans2;
  9.     system("cls");
  10.     cout << "\nOnline Money Transfer\n";
  11.     cout << "------------------------------------\n";
  12.     cout << "[C]redit [S]aving [O]ther\n";
  13.     cout << "Select Transaction: ";
  14.     cin >> trans1;
  15.     cout << "------------------------------------\n";
  16.     if (trans1 == 'c' || trans1 == 'C') {
  17.         cout << "Amount to Transfer: *** ";
  18.         cin >> aTransfer;
  19.         tFee = aTransfer * 0.10;
  20.         sFee = aTransfer * 0.10;
  21.     cout << "Transfer Fee: *********  "  << fixed << setprecision(2) << tFee << "\n";
  22.     cout << "Service Fee: **********  "  << fixed << setprecision(2) << sFee;
  23.     cout << "\n------------------------------------\n";
  24.     cout << "Enter Card Number: ";
  25.     cin >> cn;
  26.     cout << "Enter PIN: ";
  27.     cin >> pin;
  28.     if (cn == "000-000-123" && pin == "123456") {
  29.         rb = aTransfer * 0.05;
  30.         amt = tFee + sFee + aTransfer;
  31.         tad = amt - rb;
  32.     cout << "--------------------------------------- \n";
  33.     cout << "Transaction Verified!\n";
  34.     cout << "Amount: *************** " << fixed << setprecision(2) << amt << endl;
  35.     cout << "Rebate: *************** " << "(" << rb << ")" << endl;
  36.     cout << "Total Amount Deducted:* " << fixed << setprecision(2) << tad << endl;
  37.     } else if (cn != "000-000-123" && pin != "123456") {
  38.         cout << "--------------------------------------- \n";
  39.         cout << "No Account Found..." << endl;
  40.         cout << "Money Transfer Cancelled!" << endl;
  41.     } else if (cn == "000-000-123" && pin != "123456") {
  42.         cout << "Wrong PIN ..." << endl;
  43.         cout << "Re-Enter PIN: ";
  44.         cin >> rpin;
  45.     if ( rpin == "123456" ) {
  46.     rb = aTransfer * 0.05;
  47.     amt = tFee + sFee + aTransfer;
  48.     tad = amt - rb;
  49.     cout << "---------------------------------------";
  50.     cout << "\nTransaction Verified!\n";
  51.     cout << "Amount: *************** " << fixed << setprecision(2) << amt << endl;
  52.     cout << "Rebate: *************** " << "(" << rb << ")" << endl;
  53.     cout << "Total Amount Deducted:* " << fixed << setprecision(2) << tad << endl;
  54.     } else {
  55.     cout << "------------------------------------ \n";
  56.     cout << "Invalid PIN..."<< endl;
  57.     cout << "Money Transfer Cancelled!"<< endl;
  58.     }}
  59.     } else if(trans1 == 's' || trans1 == 'S') {
  60.         cout << "Amount to Transfer: *** ";
  61.         cin >> aTransfer;
  62.         tFee = (aTransfer/1000)*20;
  63.         sFee = 0;
  64.     cout << "Transfer Fee: *********   " << fixed << setprecision(2) << tFee << endl;
  65.     cout << "Service Fee: **********    " << fixed << setprecision(2) << sFee;
  66.     cout << "\n------------------------------------\n";
  67.     cout << "Enter Card Number: ";
  68.     cin >> cn;
  69.     cout << "Enter PIN: ";
  70.     cin >> pin;
  71.     if (cn == "000-000-123" && pin == "123456") {
  72.     rb = 0;
  73.     amt = tFee + sFee + aTransfer;
  74.     tad = amt - rb;
  75.     cout << "---------------------------------------";
  76.     cout << "\nTransaction Verified!\n";
  77.     cout << "Amount: *************** " << fixed << setprecision(2) << amt << endl;
  78.     cout << "Rebate: *************** " << "(" << rb << ")" << endl;
  79.     cout << "Total Amount Deducted:* " << fixed << setprecision(2) << tad << endl;
  80.     } else if (cn != "000-000-123" && pin != "123456") {
  81.         cout << "------------------------------------\n";
  82.         cout << "No Account Found..."<< endl;
  83.         cout << "Money Transfer Cancelled!"<< endl;
  84.     } else if (cn == "000-000-123" && pin != "123456") {
  85.         cout << "Wrong PIN ..."<< endl;
  86.         cout << "Re-Enter PIN: ";
  87.         cin >> rpin;
  88.     if ( rpin == "123456" ) {
  89.         rb = 0;
  90.         amt = tFee + sFee + aTransfer;
  91.         tad = amt - rb;
  92.         cout << "---------------------------------------";
  93.         cout << "\nTransaction Verified!\n";
  94.         cout << "Amount: *************** " << fixed << setprecision(2) << amt << endl;
  95.         cout << "Rebate: *************** " << "(" << rb << ")" << endl;
  96.         cout << "Total Amount Deducted:* " << fixed << setprecision(2) << tad << endl;
  97.     } else {
  98.     cout << "------------------------------------ \n";
  99.     cout << "Invalid PIN..."<< endl;
  100.     cout << "Money Transfer Cancelled!"<<endl;
  101.     }}
  102.     } else if(trans1 == 'o' || trans1 == 'O') {
  103.         cout << "[1]Paypal [2]Paymaya [3]GCash" << endl;
  104.         cout << "Select Transaction: ";
  105.         cin >> trans2;
  106.         cout << "------------------------------------\n";
  107.     if (trans2 == "1") {
  108.         cout << "Amount to Transfer: *** ";
  109.         cin >> aTransfer;
  110.         tFee = 0;
  111.         sFee = 50;
  112.     cout << "Transfer Fee: *********    " << fixed << setprecision(2) << tFee << endl;
  113.     cout << "Service Fee: **********   " << fixed << setprecision(2) << sFee << endl;
  114.     cout << "\n------------------------------------\n";
  115.     cout << "Enter Card Number: ";
  116.     cin >> cn;
  117.     cout << "Enter PIN: ";
  118.     cin >> pin;
  119.     if (cn == "000-000-123" && pin == "123456") {
  120.         rb = 0;
  121.         amt = tFee + sFee + aTransfer;
  122.         tad = amt - rb;
  123.     cout << "---------------------------------------";
  124.     cout << "\nTransaction Verified!\n";
  125.     cout << "Amount: *************** " << fixed << setprecision(2) << amt << endl;
  126.     cout << "Rebate: ***************  " << "(" << rb << ")" << endl;
  127.     cout << "Total Amount Deducted:* " << fixed << setprecision(2) << tad << endl;
  128.     } else if (cn != "000-000-123" && pin != "123456") {
  129.         cout << "------------------------------------\n";
  130.         cout<<"No Account Found..."<<endl;
  131.         cout<<"Money Transfer Cancelled!"<<endl;
  132.     } else if (cn == "000-000-123") {
  133.         cout << "Wrong PIN ..."<<endl;
  134.         cout << "Re-Enter PIN: ";
  135.         cin >> rpin;
  136.     if( rpin == "123456" ) {
  137.         rb = 0;
  138.         amt = tFee + sFee + aTransfer;
  139.         tad = amt - rb;
  140.         cout << "---------------------------------------";
  141.         cout << "\nTransaction Verified!\n";
  142.         cout << "Amount: *************** " << fixed << setprecision(2)<< amt << endl;
  143.         cout << "Rebate: ***************  " << "(" << rb << ")" << endl;
  144.         cout << "Total Amount Deducted:* " << fixed << setprecision(2)<< tad << endl;
  145.     } else {
  146.         cout << "------------------------------------ \n";
  147.         cout<<"Invalid PIN..."<<endl;
  148.         cout<<"Money Transfer Cancelled!"<<endl;
  149.     }}
  150.     } else if (trans2 == "2" || trans2 == "3") {
  151.         cout << "Amount to Transfer: *** ";
  152.         cin >> aTransfer;
  153.         tFee = 0;
  154.         sFee = 15;
  155.         cout << "Transfer Fee: *********    " << fixed << setprecision(2) << tFee << endl;
  156.         cout << "Service Fee: **********   " << fixed << setprecision(2) << sFee << endl;
  157.         cout << "\n------------------------------------\n";
  158.         cout << "Enter Card Number: ";
  159.         cin >> cn;
  160.         cout << "Enter PIN: ";
  161.         cin >> pin;
  162. if (cn == "000-000-123" && pin == "123456") {
  163.         rb = aTransfer * 0.10;
  164.         amt = tFee + sFee + aTransfer;
  165.         tad = amt - rb;
  166.     cout << "---------------------------------------";
  167.     cout << "\nTransaction Verified!\n";
  168.     cout << "Amount: *************** " << fixed << setprecision(2) << amt << endl;
  169.     cout << "Rebate: *************** " << "(" << rb << ")" << endl;
  170.     cout << "Total Amount Deducted:* " << fixed << setprecision(2) << tad << endl;
  171. } else if (cn != "000-000-123" && pin != "123456") {
  172.     cout << "------------------------------------\n";
  173.     cout<<"No Account Found..."<<endl;
  174.     cout<<"Money Transfer Cancelled!"<<endl;
  175. } else if (cn == "000-000-123" && pin != "123456") {
  176.     cout << "Wrong PIN ..."<<endl;
  177.     cout << "Re-Enter PIN: ";
  178.     cin >> rpin;
  179.     if( rpin == "123456" ) {
  180.         rb = aTransfer * 0.10;
  181.         amt = tFee + sFee + aTransfer;
  182.         tad = amt - rb;
  183.     cout << "---------------------------------------";
  184.     cout << "\nTransaction Verified!\n";
  185.     cout << "Amount: *************** " << fixed << setprecision(2) << amt << endl;
  186.     cout << "Rebate: *************** " << "(" << rb << ")" << endl;
  187.     cout << "Total Amount Deducted:* " << fixed << setprecision(2) << tad << endl;
  188.     } else {
  189.     cout << "------------------------------------ \n";
  190.     cout<<"Invalid PIN..."<<endl;
  191.     cout<<"Money Transfer Cancelled!"<<endl;
  192. }}}
  193. } else {
  194.     cout<<"Invalid Selection"<<endl;
  195.     cout<<"Money Transfer Cancelled!"<<endl;
  196. }
  197. return 0;
  198. }
Add Comment
Please, Sign In to add comment