Thread: ATM on a system???

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    23

    ATM on a system???

    I have an ATM program.. and as a project my prof. ask me to make an ATM in a system??? it is possible that my ATM will store username and password?? and it save all the transaction in a notepad?? anyone give me a reference where I get some codes to apply on my program.. and as a big help if anyone has already done with this?? please give me an example...

    here's my very simple ATM program..

    Code:
    #include <stdio.h>
    #include <conio.h>
    double amount=10000;
    double dep(double y)
    {
    double account;
    account=amount+y;
    return account;
    }
    double with(double x)
    {
    double account,y;
    y=amount;
    account=amount-x;
    if(x>4000)
    printf("The largest amount you can withdraw is 4000\n");
    else if(x>amount)
    printf("The smallest amount you can withdraw is 200\n");
    else
    amount=amount-x;
    printf("&#37;lf",amount);
    return 0;}
    void main()
    {
    int i=0;
    double x;
    double y;
    clrscr();
    printf("\n*******MENU*********\n");
    printf("1.Balance Enquiry\n");
    printf("2.Withdraw\n");
    printf("3.Deposit\n");
    printf("4.Exit\n");
    printf("Select an item from the menu: ");
    scanf("%d",&i);
    while(i<4)
    {
    switch(i)
    {
    case 1:printf("This is your balance amount: %f",amount);
    break;
    case 2:printf("How much would you like to withdraw?");
    scanf("%lf",&y);
    //amount = amount-y;
    with(y);
    //printf("This is your balance amount: %f",amount);
    break;
    case 3:printf("How much amount do want to deposit?\n");
    scanf("%lf",&x);
    amount = amount+x;
    printf("This is your balance amount: %f",amount);
    break;
    }
    printf("\n*********MENU*********...\n");
    printf("1.Balance Enquiry\n");
    printf("2.Withdraw\n");
    printf("3.Deposit\n");
    printf("4.Exit\n");
    printf("If you are a first time user please deposit some amount for balance enquiry.\n");
    printf("Select an item from the menu: ");
    scanf("%d",&i);
    }
    getch();
    }
    This program is 100% working..
    but...
    I don't know how to start...
    this is our last project, and this is the hardiest program for me..

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Yes, of course it's possible.

    The minimum you need is to store, in a file, the account information (name or number, and password), and the current balance of the account.

    If you want to allow multiple accounts, you would have to list the account info along with their respective balances.

    You need to read up on file input and output (and opening/closing files).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    You might want to read the section in the FAQ about working with files:

    http://faq.cprogramming.com/cgi-bin/...&id=1043284392

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Operating System
    By Houssen in forum C Programming
    Replies: 18
    Last Post: 04-22-2008, 12:51 PM
  2. File System Implementation
    By dodgeviper in forum C Programming
    Replies: 9
    Last Post: 11-16-2007, 01:04 PM
  3. Using system icons
    By @nthony in forum Windows Programming
    Replies: 1
    Last Post: 01-13-2007, 07:56 PM
  4. Linux database system needed
    By BobS0327 in forum Tech Board
    Replies: 7
    Last Post: 06-11-2006, 03:56 PM
  5. BIOS system and memory allocation problem
    By beely in forum Tech Board
    Replies: 9
    Last Post: 11-25-2003, 07:12 AM