Jump to content

naji

Member
  • Posts

    40
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Maldives

About naji

  • Birthday 03/12/1982

Contact Methods

  • MSN
    strangefruit69@hotmail.com
  • Website URL
    http://

naji's Achievements

0

Reputation

  1. jaclaz: yea that helps.. but i was actually talking abt the unit itself... compacting all the hardware devices into a smaller chassis... like a commercially available NAS unit, the hardware components of an external hdd chassis with ethernet support
  2. does anyone know how these NAS devices like the linksys EFG250 are built? u guys think its possible to build one? any links or anything at all is much appreciated.
  3. well...its an assignment i m supposed to do...for my Programming class. I have to give them the code!!!! and obviously it has to be in C....my lecturer is stupid but i suspect he can tell the difference between C and machine code
  4. you mean this code can be directly compiled to C!!! name some of these compilers for me please... why? because i need the code in pure C...
  5. Can somone pleeeeeeeeeeeeeeeease help me change the following code from c++ to c..... # 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(); } }
  6. Can someone pls help me find a source code for an Automatic Teller Machine software in C language? I m supposed to come up with that as a first semester assignment...I just need to look at some examples and get some ideas... pls help
  7. I need to create an unattended windows installation point on my office LAN. Can someone please show me where i should begin my reading... Links, guides, any help appreciated... thnks
  8. naji

    english manual?

    i read most of the original thread abt WIHU....i stilll cant figure out how this works...when is someone going to translate the original manual in english??
  9. i would like to have an invitation pls...
  10. maybe i should rephrase... Does anyone here have a good dreamweaver mx manual? and if so would you mind sharing it ? im not really familiar with kazaa...and dont have the time to get to know it! or maybe im just too **** lazy...
  11. Can someone tell me where i can find a good dreamweaver MX manual....preferably somthing free thanks
  12. a self phone ??? whats a self phone?
  13. why bother?? i dont think the resulting mp3, would have better sound quality than the original!
  14. Try NetSwitcher V3.2.6....could be what you are looking for! http://www.netswitcher.com/downloads.htm hope it helps
  15. naji

    folder images?

    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
×
×
  • Create New...