Jump to content

naji

Member
  • Posts

    40
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Maldives

Posts posted by naji

  1. Can somone pleeeeeeeeeeeeeeeease help me change the following code from c++ to c..... :unsure:

    # include <fstream>
    # include <iostream>
    #include <iomanip>


    using namespace std;


    class cust
    {
    private:

    char *FirstNameId;
    char *LastNameId;
    int    num_of_recs;
    int    ChkAcctId;
    double ChkAcctBal;
    double SavAcctBal;
    int    PIN;


    public:
    void setFirstNameId  (char *FirstName)    {FirstNameId = strdup(FirstName);};
    void setLastNameId  (char *LastName)    {LastNameId = strdup(LastName);};
    void setChkActId     (int ChkId)           {ChkAcctId = ChkId;};
    void setChkAcctBal   (double ChkBal)       {ChkAcctBal = ChkBal;};
    void setSavAcctBal   (double SavBal)       {SavAcctBal = SavBal;};
    void setPIN          (int PIN_num)         {PIN = PIN_num;};
    void displayBalance  ();
    void depos           (int selec, double depAmnt);
    void withdrawl       (int selec, double withdrawalAmnt);
    void transferFunds   (int transdirect, double transAmnt);
    int  Cust_pin        ()                    {return PIN;};
    const char* getFirstNameId()       {return FirstNameId;};
    const char* getLastNameId()           {return LastNameId;};
    int    getChkActId   ()                    {return ChkAcctId;};
    double getChkAcctBal  ()       {return ChkAcctBal;};
    double getSavAcctBal ()        {return SavAcctBal;};

    };


    void cust::displayBalance()
    {
    cout <<setprecision(2) <<setiosflags(ios::fixed | ios::showpoint);
    cout <<endl<< "\t\t\tChecking Account Balance : $"<<ChkAcctBal<<endl;
    cout << "\t\t\tSavings Account Balance  : $"<<SavAcctBal<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl;
    return;
    }


    void cust::depos(int selec, double deposit)
    {
    if (selec == 2)
    {
     ChkAcctBal = ChkAcctBal + deposit;
     cout <<setprecision(2) <<setiosflags(ios::fixed | ios::showpoint);
     cout << "\t\t\tDeposited to Checking: $" <<deposit<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl;
    }

    if (selec == 1)
    {
     SavAcctBal = SavAcctBal + deposit;
     cout <<setprecision(2) <<setiosflags(ios::fixed | ios::showpoint);
     cout << "\t\t\tDeposited to Savings: $"<<deposit<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl;
    }
    }



    void cust::withdrawl(int selec, double withdrawalAmnt)
    {

    if (selec == 1 && (SavAcctBal - withdrawalAmnt >= 0) )
    {
     SavAcctBal = SavAcctBal - withdrawalAmnt;
     cout <<setprecision(2) <<setiosflags(ios::fixed | ios::showpoint);
     cout <<endl<<"\t\t\tWithdrawal Successfull : $"<<withdrawalAmnt<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl;
    }
    else if (selec == 1 && (SavAcctBal - withdrawalAmnt < 0) )
    {
     cout << "\t\t\tCannot Complete Transaction"<<endl<<endl;
     cout <<endl<< "\t\t\t    Insufficient Funds"<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl;
    }

    if (selec == 2 && (ChkAcctBal - withdrawalAmnt >= 0))
    {
     ChkAcctBal = ChkAcctBal - withdrawalAmnt;
     cout <<setprecision(2) <<setiosflags(ios::fixed | ios::showpoint);
     cout <<endl<<"\t\t\tWithdrawal Successfull : $"<<withdrawalAmnt<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl;
    }
    else if (selec == 2 && (ChkAcctBal - withdrawalAmnt < 0))
    {
     cout <<"\t\t\tCannot Complete Transaction"<<endl<<endl;
     cout <<endl<<"\t\t\t    Insufficient Funds"<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl;
    }
    }


    void cust::transferFunds (int transdirect, double transAmnt)
    {
    if ( transdirect == 1 && (SavAcctBal - transAmnt >= 0))
    {
     SavAcctBal = SavAcctBal - transAmnt;
     ChkAcctBal = ChkAcctBal + transAmnt;
     cout <<setprecision(2) <<setiosflags(ios::fixed | ios::showpoint);
     cout << "\t\t\t     Transfer Successful"<<endl<<endl;
     cout << "\t\t\t$"<<transAmnt<<" Transferred into Checking"<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl;
    }
    else if (transdirect == 1 && (SavAcctBal - transAmnt < 0))
    {
     cout <<"\t\t\tCannot Complete Transaction"<<endl<<endl;
     cout <<"\t\t\t   Insufficient Funds"<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl;
    }
    if ( transdirect == 2 && (ChkAcctBal - transAmnt >= 0))
    {
     ChkAcctBal = ChkAcctBal - transAmnt;
     SavAcctBal = SavAcctBal + transAmnt;
     cout <<setprecision(2) <<setiosflags(ios::fixed | ios::showpoint);
     cout << "\t\t\t     Transfer Successful"<<endl<<endl;
     cout << "\t\t\t$"<<transAmnt<<" Transferred into Savings"<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl;
    }
    else if ( transdirect == 2 && (ChkAcctBal - transAmnt < 0))
    {
     cout << "\t\t\tCannot Complete Transaction"<<endl<<endl;
     cout << "\t\t\t    Insufficient Funds"<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl;
    }
    }

    //atm class definition
    //#include <iostream.h>
    //#include <fstream.h>
    //#include <iomanip.h>

    class atm
    {
    private:
    int    pin;
    int    transtype;
    double amnt;
    int    transDirec;
    int    accnt;

    public:
    void   setpin();
    int    getpin() {return pin;};
    int    displayMenu();
    int    getAcct();
    double getAmnt();
    int    getDirection();
    void   clear();
    void   incorrectPinDisp(int cntr);
    char   ContinueDisp();
    void   transCompleteDisp();
    void   atmGoodbye();

    };


    void atm::setpin()
    {
    cout <<endl<<endl<<endl<<endl<<endl;
    cout <<"\t\t\t------------------------"<<endl;
    cout <<"\t\t\t-      Welcome To      -"<<endl;
    cout <<"\t\t\t-      First Bank      -"<<endl;
    cout <<"\t\t\t------------------------"<<endl<<endl;
    cout <<"\t\t\tEnter your Pin Number: ";
    cin  >>pin;
    }

    int atm::displayMenu()
    {
    int selection =  0;

    while (selection > 5 || selection < 1)
    {
     cout <<endl<< "\t\t\t1 - Display Balance"<<endl;
     cout << "\t\t\t2 - Deposit"<<endl;
     cout << "\t\t\t3 - Withdrawl"<<endl;
     cout << "\t\t\t4 - Transfer Funds"<<endl;
     cout << "\t\t\t5 - Exit"<<endl;
     cout << "\t\t\t--------------------"<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl;
     cout << "\t\t\tSelect a Transaction: ";
     cin  >>selection;
     cout <<endl<<endl<<endl<<endl;

     if (selection == 1 || selection == 2 || selection == 3
     || selection == 4 || selection == 5)
     {
     }
     else
     {
     cout <<endl<< "\t\t\tInvalid Selection"<<endl;
     cout << "\t\t\tSelect 1 through 5 : ";
     cin  >> selection;
     }
    }
    transtype = selection;

    return selection;

    }


    int atm::getAcct()
    {

    int    acnttype = 0;

    while (acnttype < 1 || acnttype > 2)
    {
    cout <<endl<< "\t\t\t1 - Savings"<<endl;
    cout << "\t\t\t2 - Checking"<<endl;
    cout << "\t\t\t-------------"<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl;
    cout << "\t\t\tSelect Account : ";
    cin  >>acnttype;
    cin.ignore(100, '\n');

    if (acnttype == 1 || acnttype == 2)
    {
    }
    else
    {
     cout <<endl<< "\t\t\tInvalid Selection"<<endl;
     cout << "\t\t\tEnter 1 or 2 : ";
     cin  >>acnttype;
     cin.ignore(100, '\n');
    }
    }
    accnt = acnttype;

    return acnttype;
    }


    double atm::getAmnt()
    {
    double amount = (float) 0.0;

    cout <<"\t\t\tPlease Enter Transaction Amount"<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl<<endl;
    cout << "\t\t\tAmount : $";
    cin  >>amount;
    amnt = amount;

    return amount;
    }

    int atm::getDirection()
    {
    int direct = 0;
       
    while (direct < 1 || direct > 2)
    {
    cout << "\t\t\t1 - Savings to Checking"<<endl<<endl;
    cout << "\t\t\t2 - Checking to Savings"<<endl<<endl;
    cout << "\t\t\t-----------------------"<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl;
    cout << "\t\t\tEnter a Selection : ";
    cin  >>direct;
    cin.ignore(100, '\n');

    if (direct == 1 || direct == 2)
    {
    }
    else
    {
     cout <<endl<< "Re-Enter selection 1 or 2"<<endl<<endl;
    }
    }
    transDirec = direct;

    return direct;
    }

    void atm::incorrectPinDisp(int cntr)
    {
    if (cntr < 3)
    {   cout <<endl<<endl<<endl<<endl<<endl;
        cout <<"\t\t\t------------------------"<<endl;
        cout <<"\t\t\t-      Welcome To      -"<<endl;
        cout <<"\t\t\t-      First Bank      -"<<endl;
        cout <<"\t\t\t------------------------"<<endl<<endl;
     cout <<endl<< "\t\t    Incorrect PIN, Please Re-Enter :";
    }
    else
    {
     cout << "\t\t\tYou Have Entered 3 Incorrect Pin Numbers\n"<<endl;
     cout << "\t\t\t        Please Contact Your Bank"<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl<<endl;
    }
    }

    char atm::ContinueDisp()
    {
    char cont = 'Y';
    cout <<endl<<"\t\t\tWould You Like Another Transaction? Y/N : ";
    cin  >>cont;
    cin.ignore(100,'\n');
    return cont;
    }

    void atm::atmGoodbye()
    {
    atm::clear();
    cout <<endl<<endl<<endl<<endl<<endl;
    cout <<"\t\t\t------------------------"<<endl;
    cout <<"\t\t\t-      Thank You       -"<<endl;
    cout <<"\t\t\t-  For Banking With Us -"<<endl;
    cout <<"\t\t\t-      First Bank      -"<<endl;
    cout <<"\t\t\t------------------------"<<endl<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl;
    }
     
    void atm::clear()
    {
    cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl
     <<endl<<endl<<endl<<endl<<endl;
    }



    void main()
    {
    int menuSelec        = 0;
    int pinHolder        = 0;
    int ArrayNum         = 1;
    int cntr             = 1;
    int selection        = 0;
    int transferDirec    = 0;
       double depAmnt       = (float) 0.0;
       double withdrawlAmnt = (float) 0.0;
    double transferAmnt  = (float) 0.0;
    char ContSw          = 'Y';


    //opens infile, checks if opened correctly.
    //if open fails message is displayed.

    ifstream custFile;
    custFile.open("test.txt");
     if (!custFile)
     {
     cout << "Unable to Access Bank Records"<<endl;
     exit(1);
     };
     
    //opens output file, checks if opened correctly.
    //if opens fails message is displayed.

    ofstream custUpdate;
    custUpdate.open("recordUpdate.txt");
     if (!custUpdate)
     {
     cout << "Error Opening Outfile"<<endl;
     exit(1);
     };
     
    int numrecs = 0;
    custFile >> numrecs;
    cust custArray[50];
    atm atm;


    char FirstName[25][80];

    //char LastName[25];
    int    ChkId;
    double ChkBal;
    double SavBal;
    int    PIN_num;


    int x = 0;    

    while(!custFile.eof()){
     custFile>>FirstName[x]>>ChkId>>ChkBal>>SavBal>>PIN_num;

     x++;
    }
    // while (custFile >> FirstName>>ChkId>> ChkBal >> SavBal >>   PIN_num )
    // {
    //   custArray[x].setFirstNameId(FirstName[x]);
    //   //custArray[x].setLastNameId(LastName[x]);
    //   custArray[x].setChkActId(ChkId);
    //   custArray[x].setChkAcctBal(ChkBal);
    //   custArray[x].setSavAcctBal(SavBal);
    //   custArray[x].setPIN(PIN_num);
    //   x++;
     
    // }


    custFile.close();


    atm.setpin();
    atm.clear();
    pinHolder = atm.getpin();
    x = 0;

    while (cntr < 4)
    {
     for ( x = 0; x < numrecs; x++)
     {
     
     if (pinHolder  == custArray[x].Cust_pin())
       {
        ArrayNum = x;
        cntr = 4;
        break;

     }
     
     }
     
       if ( x == numrecs)
       {
     
       if (cntr < 3)
       {
       atm.incorrectPinDisp(cntr);
       cin >> pinHolder;
       atm.clear();
       cntr++;
       }
       else
       {
       atm.incorrectPinDisp(cntr);
       exit(0);
       }
     
      }

    }


       do
    {  
     if (toupper(ContSw) == 'Y')
     {
      menuSelec = atm.displayMenu();
     }
     else if (toupper(ContSw) == 'N' || menuSelec == 5)
     {
     atm.atmGoodbye();
     break;
     }

       switch (menuSelec)
       {
        case 1:
     atm.clear();
         custArray[ArrayNum].displayBalance();
     ContSw = atm.ContinueDisp();
     atm.clear();
     break;

        case 2:
     atm.clear();
         selection = atm.getAcct();
     atm.clear();
         depAmnt = atm.getAmnt();
     atm.clear();
         custArray[ArrayNum].depos( selection, depAmnt);
     ContSw = atm.ContinueDisp();
     atm.clear();
     break;

        case 3:
     atm.clear();
     selection = atm.getAcct();
     atm.clear();
         withdrawlAmnt = atm.getAmnt();
     atm.clear();
         custArray[ArrayNum].withdrawl( selection, withdrawlAmnt);
     ContSw = atm.ContinueDisp();
     atm.clear();
     break;

        case 4:
     atm.clear();
     transferDirec = atm.getDirection();
     atm.clear();
     transferAmnt = atm.getAmnt();
     atm.clear();
     custArray[ArrayNum].transferFunds (transferDirec, transferAmnt);
     ContSw = atm.ContinueDisp();
     atm.clear();
     break;
       
        case 5:
     atm.atmGoodbye();
       }
       
    }while (menuSelec != 5);


    if (toupper (ContSw) == 'N' || menuSelec == 5)
    {

     custUpdate <<numrecs<<endl<<endl;

     for ( x = 0; x < numrecs; x++)
       
     { //for (y = 0;; y++){
       strcpy(FirstName[x],custArray[x].getFirstNameId());
       //LastName[x] = custArray[x].getLastNameId();
       ChkId = custArray[x].getChkActId();
       ChkBal= custArray[x].getChkAcctBal();
       SavBal = custArray[x].getSavAcctBal();
       PIN_num = custArray[x].Cust_pin();
       
       custUpdate <<setprecision(2)<<setiosflags(ios::fixed | ios::showpoint);
       custUpdate <<FirstName << " "  << ChkId <<" "<<ChkBal
       <<" "<<SavBal<<" "<<PIN_num<<endl<<endl;
     }

     custUpdate.close();

    }

    }

  2. I never tried UltraISO, sounds like its for creating CD images...not exactly what i had in mind...but would like to try it, can u give me a link? is it freeware?

    I never used winRAR to compress anything larger than just a few megabytes...im talking about compressing folders about 10 GBs big!!!

    How long would winRAR take to handle such large folders? to compress and to decompress??

    i was thinking of somthing like ghost...taking a snapshot of the data structure from the source drive, if thats possible...another program i know is drive snapshot which is also included in Bart PE...again like ghost, drive snapshot also backs up entire partitions or drives...although drive snapshot cannot copress the image as much as Ghost does...

    thanks

  3. i tried looking for an answer but couldnt find any...

    how can i plug-in ghost 2003 into bart PE?? the instructions in PE builder are for ghost 8 and the following files are required, ghost32.exe, ghostexp.exe, ghostsrv.exe, ghostcdr.dll....

    Only ghostexp.exe is included in ghost 2003 version. Pls explain how i can intergrate the 2003 version into Bart PE.

    following is a list of all the files from ghost 2003 installation folder,

    gdisk32.exe

    gdisk.exe

    GhoShExt.dll

    Ghost Boot wizard.chm

    Ghost Boot Wizard.exe

    ghost.env

    ghost.exe

    GhostExp.chm

    GhostExp.exe

    ghostpe2003.product

    GhostStart.chm

    GhostStart.exe

    GhostStartService.exe

    GhostStartTrayApp.exe

    GhPciScan.sys

    GhReboot.exe

    ghstwalk.exe

    ghwrap.exe

    INT86_16.DLL

    Int86_32.dll

    NSWiGho.dll

    nswigho.nsi

    VPartition.dll

    any help appreciated... :)

  4. came here to learn how to make an unattended installation disk...but this place proved to have a lot more to offer than just that... i have learnt a lot since i found out about the site. a great resource for anyone working with computers.

    i work at the Acer authorised distributer here in the Maldives. and have substantial knowledge in computer hardware and networking.

    thanks for all the help

    naji

  5. guys...thanks for all the help....and thanks to XtremeMaCs' Process Explorer, i found a file named rund11.exe in the system32 folder....which was causing the mario issues...everything is back to normal after this file was deleted...

    thanks all and XtremeMac...that was a pretty usefull tool u introduced... :thumbup

  6. (prathapml  Posted: Sep 23 2004, 12:30 PM)

    1. First off, in folder options, ensure that both "hidden" and "system" files are asked to be visible.

    2. Go to "Control Panel >> System Properties >> System Restore".

    3. And put a check-mark at the "turn off System restore on all drives".

    4. open "C:\Documents and Settings\USER_NAME\Local Settings\Temp" and delete all contents of that folder.

    5. Clean out "C:\WINDOWS\Temp" as well.

    6. Clean out the pre-fetch folder (C:\WINDOWS\Prefetch) as well.

    7. Empty the recycle bin and re-boot.

    8. Log back in (after reboot) and re-enable system restore.

    prathapmal... i cleaned the folders u mentioned...and still have not yet resolved the issue...pls advice
    (sleepnmojo Posted: Sep 23 2004, 07:17 PM) Don't know if this is against the rules, but why don't you post it. I don't mind taking a look at it.

    @sleepnmojo....ok ill uploadt it to my free webspace and post a link later....and if it is against the rules sombody better warn me.... ;)

    (TomcaT Posted: Sep 24 2004, 06:09 AM)

    I searched Norton and found this, it might just help you, READ IT ALL before you start......

    @TomcaT...im confused ... i did some google searches and associated the symptoms i described to the following names....are they all the same and is W32.Stuplo also releated to the names below??

    W32.HLLW.Foxma (NAV)

    W32/Mario.worm.b

    Win32.HLLW.Mario (AVP)

    W32/Foxma.worm

    WORM_FOXMA.A

    Win32.HLLW.Foxma

    W32/HLLW.Foxmango

    PE_HLLW.FOXM.A

    Win32.Foxmagno

    W32/Foxmagno

    (SiMoNsAyS Posted: Sep 24 2004, 06:19 AM)

    LoL a spanish language vir

    i think it can be safely removed if you delete mario.exe

    @SiMoNsAyS.... i have tried deleting the files buddy...and i m using the english version of windows XP pro. so i would not have a folder named Menu' Inicio would I?

    (oioldman Posted: Sep 24 2004, 06:33 AM)

    From the mcafee site you can download a program called stinger.exe which is a standalone program.

    It does not need installing and will find and remove a large number of virus.

    @oioldman, i did download the standalone utillity stinger from the link u provided and unfortunately it didnt cure the mario syndrome....besides i dont think stinger is written for any of the viruses i listed above....but still its a great tool....thanks for the link.

    im lost guys...help

  7. @prathapmal....sorry abt that....i get a bit paranoid at times...my search assistant is still the default (rover the dog) and earlier i deleted the stuff i found in windows/prefetch and the registry...but i did not clean everything u mentioned in ur earlier post...i ll give it a try and let u know...and yes system restore is as always off in my pcs'...i never use the feature....and since u pretty much run the show around here i would like to know ur personal favourite AV software...

    lately i have been using AVG antivirus...its fast and detects stuff that nortan cant....

    @crahak....yes i agree....i like nortan antivirus less and less everyday....the **** thing slows down the system especialy after a while...

  8. why cant norton antivirus clean it?? this virus was around since 2002...right?

    since i dont have McAfee antivirus is there any other way i could get around this?

    Prathapmal....i ll give it a try when go to work tommorow....its my pc at work thats having the virus...and what was that about using a genuine search assistant?? was somthing wrong with my original question? did i give obsolete info?? man im just looking around and im new? i can do without the mockery!!

    anyway thanks for the help...still the best place to ask... ;)

  9. my pc copies a file named mario.exe to the floppy drive whenever i insert a floppy....help

    i found a file named mario in the windows prefetch folder and two references to the files VB6ES.DLL and mario.exe in HKEY_CURRENT_USER/Software/Microsoft/Search Assistant/ACMru/5603/

    Nortant Antivirus 2004 or AVG antivirus does not detect any threats...

    what is mario???

    HELP?

×
×
  • Create New...