Banking System-please help!


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Banking System-please help!

  1. #1
    Join Date
    Mar 2003
    Posts
    3

    Unhappy Banking System-please help!

    Hi everyone,

    I've got an assignment to hand in a week time, i was just wondering if anyone is willing to help me out with it.

    the problem iam facing at the moment is to take the input from a text field and insert it into a file.

    the whole program is about a banking system which the user is able to Credit, Debit and check the balance of his or her account. the following is the specification of the program.

    _____________________________________________

    REQUIREMENTS

    Server-side: create the necessary facilities to service customer needs for basic transactions on a personal bank account.
    Client-side: create an interface to permit customers to remotely access basic transactions on a personal bank account server.
    Each transaction will require:
    a customer identifier: a string
    an indicator for the transaction type: { C , D , B }
    C: Credit; D: Debit; B: Balance enquiry.
    a value representing the difference a float
    between the opening and closing balance
    an opening balance: a float
    a closing balance: a float
    the date of the transaction: a date
    a transaction concluded ?success? flag: a boolean

    A total of 1 only text files should be used by your system (server-side) to store the account details, i.e. each transaction, for every customer. Each transaction should be recorded as a single line entry of tab separated values. You may wish to create a second file to maintain a list of valid customer Ids: when a new entry is made to this file it should be accompanied by the creation of an opening transaction. This should be recorded within the account details file as a transaction, a Balance transaction, of zero value, on an opening balance of zero.

    --------------------------------------------
    the file name should be: transactions.txt and should look exactly like the following:

    000001 B 0.00 0.00 0.00 1 2 2003 true
    000002 B 0.00 0.00 0.00 1 2 2003 true
    000003 B 0.00 0.00 0.00 1 2 2003 true
    000004 B 0.00 0.00 0.00 1 2 2003 true
    000005 B 0.00 0.00 0.00 1 2 2003 true
    000006 B 0.00 0.00 0.00 1 2 2003 true
    000007 B 0.00 0.00 0.00 1 2 2003 true
    000008 B 0.00 0.00 0.00 1 2 2003 true
    000009 B 0.00 0.00 0.00 1 2 2003 true
    -----------------------
    for the exact layout please email me on : basmah3@hotmail.com
    ___________________________________________

    to see the MARK REQUIREMENTS/CRITERIA please find the attachment.

    _______________________________


    Iam not good at Java at all but i wana get a good marks on this assignment i know there must be some top java programmers in this forum so please help......

    thank you very much..
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2003
    Posts
    834
    I recommend you ask shorter questions, rather than trying to get someone to do your entire coursework for you!

    So as a start: "How do I get input from a file?"

    Code:
    import java.io.*;
    
    public class ReadFile {
            public static void main(String[] args) throws IOException {
                    String fileName = "myFile.txt";
                    BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(fileName))));
                    String line = br.readLine();
                    while(line != null) {
                            System.out.println("Line: " + line);
                            line = br.readLine();
                    }
            }
    }
    That should get you started...
    ArchAngel.
    O:-)

  3. #3
    Join Date
    Mar 2003
    Posts
    3
    thank you ArchAngel for yr reply,

    i could easily read from a file, but i wanna be able to insert some text into that file through a text field via a socket... !!!

    thanks

  4. #4
    Join Date
    Mar 2003
    Posts
    834
    So which bit are you having trouble with? Inserting a line into the text file or connecting to a server via a socket?
    ArchAngel.
    O:-)

  5. #5
    Join Date
    Mar 2003
    Posts
    3
    im using FilePrinter to insert a line into the file specified in the code. the following is the code used :

    ----------
    PrintWriter out = new PrintWriter(
    new FileWriter("Bank.txt"));
    out.println();
    out.close();
    -------------

    the line out.println(); is what causing the problem as i have no idea of what i should pass into this statement, i cant pass the text field, not even theSocket, and whatever i try i stil unable to print into the file.

    any idea?!!!

    thanks..

  6. #6
    Join Date
    Mar 2003
    Posts
    17
    You should be sending in the String you actually want to write to the file.

    You mentioned text field.. is this referring to actual text (i.e. a String), or a TextField object?

    If the first, it should have worked .. post your code, perhaps we can see whats gone wrong..

    if you tried to pass in an actual TextField object, what you need to do is get the string held in the object, and pass that through println()

    eg
    Code:
       out.println(myTextField.getText());
    Laziness is a virtue.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center