Java Gurus Help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew Bell

    Java Gurus Help

    I'm doing a uni course in the UK and one of my semesters is about
    programming. This is just going to be compilied and executed with no menu
    just using command promt (javac classfile.class )

    I am not that good at programming but what I need to know is in java how
    would i do this........... .......

    menu appears, user selects menu option (1,2,3,4,5,6) a new menu appears
    after selecting option 1 asking the user to select another option
    (A.B.C.D.E.F).. ... What I need to know is will this be a IF
    statement...... ..

    If (Variable1 = = '1')
    {
    do this line
    {
    if (Variable = = '2)
    do this line
    (
    if (Variable = = '3')
    {
    do this line E.T.C for each variable.

    What i need to do is let the user choose from the first menu and then be
    able to select a second menu, but i dont no how to call the second menu for
    more than option 1, so if a user selects 2 how do i call it aswell. ? I hope
    you can understand what I mean. If not then please ask me what you need to
    know and i will try and help to help you understand what i mean.

    Thanks


  • IchBin

    #2
    Re: Java Gurus Help

    Andrew Bell wrote:[color=blue]
    > I'm doing a uni course in the UK and one of my semesters is about
    > programming. This is just going to be compilied and executed with no menu
    > just using command promt (javac classfile.class )
    >
    > I am not that good at programming but what I need to know is in java how
    > would i do this........... .......
    >
    > menu appears, user selects menu option (1,2,3,4,5,6) a new menu appears
    > after selecting option 1 asking the user to select another option
    > (A.B.C.D.E.F).. ... What I need to know is will this be a IF
    > statement...... ..
    >
    > If (Variable1 = = '1')
    > {
    > do this line
    > {
    > if (Variable = = '2)
    > do this line
    > (
    > if (Variable = = '3')
    > {
    > do this line E.T.C for each variable.
    >
    > What i need to do is let the user choose from the first menu and then be
    > able to select a second menu, but i dont no how to call the second menu for
    > more than option 1, so if a user selects 2 how do i call it aswell. ? I hope
    > you can understand what I mean. If not then please ask me what you need to
    > know and i will try and help to help you understand what i mean.
    >
    > Thanks
    >
    >[/color]
    As for the selection of one menu, with (1,2,3,4,5,6) options, that
    displays a another menu, with (A.B.C.D.E.F) options, does not seem to
    make sense. You can not have one menu option popup another menu unless
    it is a popup menu but that can not be what you mean..

    Are you not sure that you have one window with a menu that you can
    select options (1,2,3,4,5,6) that opens a new window that has it own
    menu with the (A.B.C.D.E.F) options, the user can select?

    You have to explain it better than you just did? Can not help you
    because it is not clear.

    As for the if statement. It can be coded three different ways depending
    on the var Type:

    If (stringVar.equa ls("1"){
    }
    else if (charVar == '1'){
    }
    else if (intVar == 1){
    }

    You can also use a SWITCH statement instead of a if statement.

    I can point you to some docs and examples but, like I said, you have to
    explain your homework in a understandable fashion. I will not give you
    the exact code but can point you to what you have to do and with what API's.



    Here is a source for information. Also another link to examples that may
    help with programming menus.




    Thanks in Advance...
    IchBin, Pocono Lake, Pa, USA

    _______________ _______________ _______________ _______________ ______________

    'If there is one, Knowledge is the "Fountain of Youth"'
    -William E. Taylor, Regular Guy (1952-)

    Comment

    • Andrew.Bell

      #3
      Re: Java Gurus Help

      This is what I have so far.

      //Andrew Bell
      public class MiniBank
      {
      public static void main(String args[])
      {
      String title[] = {"Current Account ", "ISA ", "Mortgage ", "Car Loan
      "};
      String ConfigMenu[] = {"A. For a specific customer, display details of
      their accounts.",
      "B. Get the ballance in an account for a specified customer.",
      "C. Add to an account for a specific customer.",
      "D. Withdraw from an account for a specified customer.",
      "E. Get the total funds in all of the current accounts in the
      bank.",
      "F. Get the total funds in all of the ISA's in the bank."};

      char Choice;
      int Customer;
      char Answer ='y';

      int[] Customer1;
      Customer1 = new int[4];
      int[] Customer2;
      Customer2 = new int[4];
      int[] Customer3;
      Customer3 = new int[4];
      int[] Customer4;
      Customer4 = new int[4];

      System.out.prin tln(" ");
      System.out.prin tln("Welcome To The Mini Bank");
      System.out.prin tln("------------------------");
      System.out.prin tln(" ");

      for (int i=0; i<4; i++)
      {
      System.out.prin t("Please Enter Amount For Customer 1's " + title[i] +
      "= ");
      Customer1[i] = EasyIn.getInt() ;
      }
      System.out.prin tln(" ");

      for (int i=0; i<4; i++)
      {
      System.out.prin t("Please Enter Amount For Customer 2's " + title[i] +
      "= ");
      Customer2[i] = EasyIn.getInt() ;
      }
      System.out.prin tln(" ");

      for (int i=0; i<4; i++)
      {
      System.out.prin t("Please Enter Amount For Customer 3's " + title[i] +
      "= ");
      Customer3[i] = EasyIn.getInt() ;
      }
      System.out.prin tln(" ");

      for (int i=0; i<4; i++)
      {
      System.out.prin t("Please Enter Amount For Customer 4's " + title[i] +
      "= ");
      Customer4[i] = EasyIn.getInt() ;
      }
      System.out.prin tln(" ");

      //User Menu
      System.out.prin tln(" ");
      System.out.prin tln("Configurat ion Menu");
      System.out.prin tln("--------------------");

      for (int i=0; i<6; i++)
      {
      System.out.prin tln(ConfigMenu[i]);
      }
      System.out.prin tln(" ");
      System.out.prin tln(" ");

      System.out.prin t("Please select an option from the above menu
      (A,B,C,D,E or F). = ");
      Choice = EasyIn.getChar( );

      if ((Choice == 'A') || (Choice == 'a'))
      {
      System.out.prin t("Please select a customer. (1,2,3 or 4) = ");
      Customer = EasyIn.getInt() ;

      if (Customer == '1')
      {
      System.out.prin t("Customer 1");

      {
      System.out.prin t("Please select an option from the above menu
      (A,B,C,D,E or F). = ");
      }
      }
      }
      }
      }




      Hope this helps the explination, basically what i need is if a user selects
      an option for example A it then returns a message back saying please select
      a customer. One the user has selected the customer it then displays the
      bank ballances. That is my full program what ive done so for. Hope this
      helps.


      Comment

      • IchBin

        #4
        Re: Java Gurus Help

        Andrew.Bell wrote:[color=blue]
        > This is what I have so far.
        >
        > //Andrew Bell[/color]

        Andrew, I tighten up some of the code. It works for your first option
        now. You can see how I did because you will have to add new methods for
        your other new options. I use a two dim array to hold your data for
        customer and options. This cuts down on a lot of extra code. You may
        want to change it to an arraylist object so that you will be able to add
        new accounts or options dynamically and not worry about the size of the
        array.

        You did not pass along that *EasyIn* object so I just used the Scanner
        class. This is close to what you were using. You can change it back but
        you will have to change a few Strings to chars. You should do that.

        Also, your code was very confusing because it did not follow any naming
        convention. At least Java guidelines for naming your vars. You had all
        upper case on the first letter of your var objects. Class names are the
        only objects that have a uppercase first char of objects name. You will
        see when you look at the code. You did a good job as far as I can tell.

        You can see the Java coding conventions at this page:


        You can look at my website under my personal tab I have a section on
        Java. It is not as nice as most but then I just keep it for myself and
        if anybody can use it, fine. For me, its beats keeping a ton of URL's in
        Bookmarks across multiple browsers.

        If you have any questions just let me know.. or someone else can help
        also..

        For coding examples, say for an arraylist, you can goto Sun's Java
        Developers Almanac, http://javaalmanac.com and search for arraylist or
        any things you are trying to do.


        [snip old code]

        import java.util.Scann er;

        public class MiniBank
        {
        static Scanner easyIn = new Scanner(System. in);

        static String validTransactio nOptions = "ABCDEFXabcdefx ";
        static boolean done = false;
        //
        // Instead using a 2 dim array to hold value Accounttype by customer
        static int[][] customerArray = new int[5][4];
        static String title[] = {"Current Account ", "ISA
        ", "Mortgage ", "Car Loan "};
        static String ConfigMenu[] = {
        "A. For a specific customer, display details of their
        accounts.",
        "B. Get the ballance in an account for a specified customer.",
        "C. Add to an account for a specific customer.",
        "D. Withdraw from an account for a specified customer.",
        "E. Get the total funds in all of the current accounts in
        the bank.",
        "F. Get the total funds in all of the ISA's in the bank.",
        "X. Finished."};

        static char choice;
        static int customer;

        public static void main(String args[])
        {
        System.out.prin tln(" ");
        System.out.prin tln("Welcome To The Mini Bank");
        System.out.prin tln("------------------------");
        System.out.prin tln(" ");

        for (int nCustomer = 1; nCustomer < 5; nCustomer++) // outer
        loop for customers
        {
        for (int ntransaction = 0; ntransaction < 4;
        ntransaction++)// inner loop for amounts
        {
        System.out.prin t("Please Enter Amount For Customer "
        + nCustomer + "'s "
        + title[ ntransaction]
        + "= ");
        // Using just one Two dim array
        customerArray[nCustomer][ntransaction] = easyIn.nextInt( );
        }
        }
        //
        //User Menu
        System.out.prin tln(" ");
        System.out.prin tln("Configurat ion Menu");
        System.out.prin tln("--------------------");

        for (int i=0; i<6; i++)
        {
        System.out.prin tln(ConfigMenu[i]);
        }
        System.out.prin tln(" ");
        System.out.prin tln(" ");
        //
        // Loop and process untill done
        while (!done) {
        getTransactionO ption();
        }
        }

        public static void getTransactionO ption()
        {
        System.out.prin t("Please select an option from the above menu
        (A,B,C,D,E For X) = ");
        String schoice = easyIn.next() ;
        //
        // Check for valid
        if (validTransacti onOptions.index Of(schoice) > -1)
        {
        if(schoice.equa ls("X") || schoice.equals( "x"))
        done = true;
        else
        {
        System.out.prin t("Please select a customer. (1,2,3 or 4) = ");
        getDisplayInfor mation(schoice, easyIn.nextInt( ));
        }
        }
        else
        {
        System.out.prin tln("Error: Invalid option selected");
        System.exit(9);
        }
        }

        static void getDisplayInfor mation(String schoice, int customer)
        {
        int typeTransaction = 0;

        if(schoice.equa ls("A") || schoice.equals( "a"))
        typeTransaction = 0;
        else if(schoice.equa ls("B") || schoice.equals( "b"))
        typeTransaction = 1;
        else if(schoice.equa ls("C") || schoice.equals( "c"))
        typeTransaction = 2;
        else if(schoice.equa ls("D") || schoice.equals( "d"))
        typeTransaction = 3;
        else if(schoice.equa ls("E") || schoice.equals( "e"))
        typeTransaction = 4;
        else if(schoice.equa ls("F") || schoice.equals( "f"))
        typeTransaction = 5;
        else
        {
        System.out.prin tln("Error: Bad Transaction Type");
        return;
        }
        System.out.prin tln();
        System.out.prin tln("Customer "+customer+ " Information for
        Selected Option '"
        + schoice + "' is: "+
        customerArray[customer][typeTransaction]);
        System.out.prin tln();
        }
        }


        Thanks in Advance...
        IchBin, Pocono Lake, Pa, USA

        _______________ _______________ _______________ _______________ ______________

        'If there is one, Knowledge is the "Fountain of Youth"'
        -William E. Taylor, Regular Guy (1952-)

        Comment

        • Andrew.Bell

          #5
          Re: Java Gurus Help

          IchBin your good, I understand what you mean. Went to compile the code and
          got this error.

          C:\Java\MiniBan k2.java:4: cannot find symbol
          symbol : class Scanner
          location: class MiniBank2
          static Scanner easyIn = new Scanner(System. in);
          ^
          C:\Java\MiniBan k2.java:4: cannot find symbol
          symbol : class Scanner
          location: class MiniBank2
          static Scanner easyIn = new Scanner(System. in);
          ^
          2 errors

          Tool completed with exit code 1

          Do you no what this means ?
          "IchBin" <weconsul@ptd.n et> wrote in message
          news:zNednaNIBe Lb_47ZUSdV9g@pt d.net...[color=blue]
          > Andrew.Bell wrote:[color=green]
          >> This is what I have so far.
          >>
          >> //Andrew Bell[/color]
          >
          > Andrew, I tighten up some of the code. It works for your first option now.
          > You can see how I did because you will have to add new methods for your
          > other new options. I use a two dim array to hold your data for customer
          > and options. This cuts down on a lot of extra code. You may want to change
          > it to an arraylist object so that you will be able to add new accounts or
          > options dynamically and not worry about the size of the array.
          >
          > You did not pass along that *EasyIn* object so I just used the Scanner
          > class. This is close to what you were using. You can change it back but
          > you will have to change a few Strings to chars. You should do that.
          >
          > Also, your code was very confusing because it did not follow any naming
          > convention. At least Java guidelines for naming your vars. You had all
          > upper case on the first letter of your var objects. Class names are the
          > only objects that have a uppercase first char of objects name. You will
          > see when you look at the code. You did a good job as far as I can tell.
          >
          > You can see the Java coding conventions at this page:
          > http://java.sun.com/docs/codeconv/ht...nvTOC.doc.html
          >
          > You can look at my website under my personal tab I have a section on Java.
          > It is not as nice as most but then I just keep it for myself and if
          > anybody can use it, fine. For me, its beats keeping a ton of URL's in
          > Bookmarks across multiple browsers.
          >
          > If you have any questions just let me know.. or someone else can help
          > also..
          >
          > For coding examples, say for an arraylist, you can goto Sun's Java
          > Developers Almanac, http://javaalmanac.com and search for arraylist or any
          > things you are trying to do.
          >
          >
          > [snip old code]
          >
          > import java.util.Scann er;
          >
          > public class MiniBank
          > {
          > static Scanner easyIn = new Scanner(System. in);
          >
          > static String validTransactio nOptions = "ABCDEFXabcdefx ";
          > static boolean done = false;
          > //
          > // Instead using a 2 dim array to hold value Accounttype by customer
          > static int[][] customerArray = new int[5][4];
          > static String title[] = {"Current Account ", "ISA ",
          > "Mortgage ", "Car Loan "};
          > static String ConfigMenu[] = {
          > "A. For a specific customer, display details of their
          > accounts.",
          > "B. Get the ballance in an account for a specified customer.",
          > "C. Add to an account for a specific customer.",
          > "D. Withdraw from an account for a specified customer.",
          > "E. Get the total funds in all of the current accounts in the
          > bank.",
          > "F. Get the total funds in all of the ISA's in the bank.",
          > "X. Finished."};
          >
          > static char choice;
          > static int customer;
          >
          > public static void main(String args[])
          > {
          > System.out.prin tln(" ");
          > System.out.prin tln("Welcome To The Mini Bank");
          > System.out.prin tln("------------------------");
          > System.out.prin tln(" ");
          >
          > for (int nCustomer = 1; nCustomer < 5; nCustomer++) // outer loop
          > for customers
          > {
          > for (int ntransaction = 0; ntransaction < 4; ntransaction++)//
          > inner loop for amounts
          > {
          > System.out.prin t("Please Enter Amount For Customer "
          > + nCustomer + "'s "
          > + title[ ntransaction]
          > + "= ");
          > // Using just one Two dim array
          > customerArray[nCustomer][ntransaction] = easyIn.nextInt( );
          > }
          > }
          > //
          > //User Menu
          > System.out.prin tln(" ");
          > System.out.prin tln("Configurat ion Menu");
          > System.out.prin tln("--------------------");
          >
          > for (int i=0; i<6; i++)
          > {
          > System.out.prin tln(ConfigMenu[i]);
          > }
          > System.out.prin tln(" ");
          > System.out.prin tln(" ");
          > //
          > // Loop and process untill done
          > while (!done) {
          > getTransactionO ption();
          > }
          > }
          >
          > public static void getTransactionO ption()
          > {
          > System.out.prin t("Please select an option from the above menu
          > (A,B,C,D,E For X) = ");
          > String schoice = easyIn.next() ;
          > //
          > // Check for valid
          > if (validTransacti onOptions.index Of(schoice) > -1)
          > {
          > if(schoice.equa ls("X") || schoice.equals( "x"))
          > done = true;
          > else
          > {
          > System.out.prin t("Please select a customer. (1,2,3 or 4) = ");
          > getDisplayInfor mation(schoice, easyIn.nextInt( ));
          > }
          > }
          > else
          > {
          > System.out.prin tln("Error: Invalid option selected");
          > System.exit(9);
          > }
          > }
          >
          > static void getDisplayInfor mation(String schoice, int customer)
          > {
          > int typeTransaction = 0;
          >
          > if(schoice.equa ls("A") || schoice.equals( "a"))
          > typeTransaction = 0;
          > else if(schoice.equa ls("B") || schoice.equals( "b"))
          > typeTransaction = 1;
          > else if(schoice.equa ls("C") || schoice.equals( "c"))
          > typeTransaction = 2;
          > else if(schoice.equa ls("D") || schoice.equals( "d"))
          > typeTransaction = 3;
          > else if(schoice.equa ls("E") || schoice.equals( "e"))
          > typeTransaction = 4;
          > else if(schoice.equa ls("F") || schoice.equals( "f"))
          > typeTransaction = 5;
          > else
          > {
          > System.out.prin tln("Error: Bad Transaction Type");
          > return;
          > }
          > System.out.prin tln();
          > System.out.prin tln("Customer "+customer+ " Information for Selected
          > Option '"
          > + schoice + "' is: "+
          > customerArray[customer][typeTransaction]);
          > System.out.prin tln();
          > }
          > }
          >
          >
          > Thanks in Advance...
          > IchBin, Pocono Lake, Pa, USA
          > http://weconsultants.servebeer.com/JHackerAppManager
          > _______________ _______________ _______________ _______________ ______________
          >
          > 'If there is one, Knowledge is the "Fountain of Youth"'
          > -William E. Taylor, Regular Guy (1952-)[/color]


          Comment

          • IchBin

            #6
            Re: Java Gurus Help

            Andrew.Bell wrote:[color=blue]
            > IchBin your good, I understand what you mean. Went to compile the code and
            > got this error.
            >
            > C:\Java\MiniBan k2.java:4: cannot find symbol
            > symbol : class Scanner
            > location: class MiniBank2
            > static Scanner easyIn = new Scanner(System. in);
            > ^[/color]
            [snip code]

            Did you leave the import statement at the top in. You will need that to
            link to the Scanner class.

            import java.util.Scann er;

            If you did then what version of Java are you using.


            Thanks in Advance...
            IchBin, Pocono Lake, Pa, USA

            _______________ _______________ _______________ _______________ ______________

            'If there is one, Knowledge is the "Fountain of Youth"'
            -William E. Taylor, Regular Guy (1952-)

            Comment

            • Andrew.Bell

              #7
              Re: Java Gurus Help

              Yep, I left the link to the Scanner class. Its alittle complicated as I've
              only been doing this for 4 months since I started UNI. Thats why my program
              was so crap. The version of Java I'm using is the latest SDK from the java
              site. Still trying to get the head around different java aspects. The one
              you did was nice but rather complicated for me to learn so quick.
              Especially with all these loops and if statments and class files its very
              hard but thank you. The way I did it I can understand and does what I
              wanted it to do but was confused on the bit for the 2nd menu so a user could
              select a customer AFTER selecting option A.
              "IchBin" <weconsul@ptd.n et> wrote in message
              news:PMydnfgqd_ 2t9o7ZUSdV9g@pt d.net...[color=blue]
              > Andrew.Bell wrote:[color=green]
              >> IchBin your good, I understand what you mean. Went to compile the code
              >> and got this error.
              >>
              >> C:\Java\MiniBan k2.java:4: cannot find symbol
              >> symbol : class Scanner
              >> location: class MiniBank2
              >> static Scanner easyIn = new Scanner(System. in);
              >> ^[/color]
              > [snip code]
              >
              > Did you leave the import statement at the top in. You will need that to
              > link to the Scanner class.
              >
              > import java.util.Scann er;
              >
              > If you did then what version of Java are you using.
              >
              >
              > Thanks in Advance...
              > IchBin, Pocono Lake, Pa, USA
              > http://weconsultants.servebeer.com/JHackerAppManager
              > _______________ _______________ _______________ _______________ ______________
              >
              > 'If there is one, Knowledge is the "Fountain of Youth"'
              > -William E. Taylor, Regular Guy (1952-)[/color]


              Comment

              • Andrew.Bell

                #8
                Re: Java Gurus Help

                I managed to get it to work, but this still leaves me with the rest of the
                program to create,

                I noticed that the import java.util.Scann er; had gone just like you said, my
                fault.

                I really wish it wasn't so hard but never mind. I'll try and get my head
                around your way but its complicated and I've only known java for 4 months
                without any other knowledge in programming. Ah lifes tuff


                Comment

                • Andrew.Bell

                  #9
                  Re: Java Gurus Help

                  Below is what my assignment involves, could you basically point me in the
                  right direction to help me acomplish the task set but not give me the
                  acctual answer.

                  SCENARIO
                  This assignment is based on a banking system. This mini bank will have 4
                  customers. The customers each have 4 different accounts (Current Account,
                  ISA Savings Account, Mortgage and Car Loan).

                  Each customer should be represented as an array with 4 elements (Each
                  element of the array will represent one of their accounts).

                  Each customer aray should be an array of intergers. Therefore all amounts
                  in the accounts are interger values.

                  Your main program should allow the user to enter the initial amounts in each
                  account for each customer and then selec from a menu in order to do the
                  following tasks.

                  1.For a sepcific customer, display details of all their accounts.
                  2.Get the balance in an account for a specific customer.
                  3.Add to an account for a specific customer.
                  4. Withdraw from an account for a sepcified customer.
                  5.Get the total funds in all of the current accounts in the bank.
                  6.Get the total funds in all of the ISA's in the bank.

                  You are to plan, design and impliment and test the mini banking system.


                  Comment

                  • IchBin

                    #10
                    Re: Java Gurus Help

                    Andrew.Bell wrote:[color=blue]
                    > I managed to get it to work, but this still leaves me with the rest of the
                    > program to create,
                    >
                    > I noticed that the import java.util.Scann er; had gone just like you said, my
                    > fault.
                    >
                    > I really wish it wasn't so hard but never mind. I'll try and get my head
                    > around your way but its complicated and I've only known java for 4 months
                    > without any other knowledge in programming. Ah lifes tuff
                    >
                    >[/color]

                    Well you can still replace the inner and outer loop and use your old
                    code. That was not the problem you were having. The problem was the
                    other end of you program. So just replace the loops and concentrate on
                    the second user selection.

                    You threw me off before when you said a menu. Menu is a GUI object and
                    not command line displays.

                    Lot's of luck and have fun!

                    Hope I was able to help...
                    IchBin, Pocono Lake, Pa, USA

                    _______________ _______________ _______________ _______________ ______________

                    'If there is one, Knowledge is the "Fountain of Youth"'
                    -William E. Taylor, Regular Guy (1952-)

                    Comment

                    • Andrew.Bell

                      #11
                      Re: Java Gurus Help

                      My apologies with throwing you off saying 'menu'. I'm still new to this
                      coding must learn the correct names for aspects of code. Thank you for your
                      time.


                      "IchBin" <weconsul@ptd.n et> wrote in message
                      news:08WdnaY0V-zw7I7ZUSdV9g@pt d.net...[color=blue]
                      > Andrew.Bell wrote:[color=green]
                      >> I managed to get it to work, but this still leaves me with the rest of
                      >> the program to create,
                      >>
                      >> I noticed that the import java.util.Scann er; had gone just like you said,
                      >> my fault.
                      >>
                      >> I really wish it wasn't so hard but never mind. I'll try and get my head
                      >> around your way but its complicated and I've only known java for 4 months
                      >> without any other knowledge in programming. Ah lifes tuff[/color]
                      >
                      > Well you can still replace the inner and outer loop and use your old code.
                      > That was not the problem you were having. The problem was the other end of
                      > you program. So just replace the loops and concentrate on the second user
                      > selection.
                      >
                      > You threw me off before when you said a menu. Menu is a GUI object and not
                      > command line displays.
                      >
                      > Lot's of luck and have fun!
                      >
                      > Hope I was able to help...
                      > IchBin, Pocono Lake, Pa, USA
                      > http://weconsultants.servebeer.com/JHackerAppManager
                      > _______________ _______________ _______________ _______________ ______________
                      >
                      > 'If there is one, Knowledge is the "Fountain of Youth"'
                      > -William E. Taylor, Regular Guy (1952-)[/color]


                      Comment

                      • Oliver Wong

                        #12
                        Re: Java Gurus Help

                        "IchBin" <weconsul@ptd.n et> wrote in message
                        news:08WdnaY0V-zw7I7ZUSdV9g@pt d.net...[color=blue]
                        > You threw me off before when you said a menu. Menu is a GUI object and not
                        > command line displays.[/color]

                        "Menu" is the name of a class in Java, and that's probably what you,
                        IchBin, were thinking. But the term "menu" was also used back when computers
                        only had text displays. They referred to exactly what Andrew is trying to
                        implement: A list of options which could be selected by pressing the code
                        (usually a single character long) associated with the desired option.

                        So Andrew wasn't "incorrect" , but rather he was "ambiguous" .

                        - Oliver

                        Comment

                        • Oliver Wong

                          #13
                          Re: Java Gurus Help


                          "Andrew.Bel l" <zen62619@zen.c o.uk> wrote in message
                          news:4413711e$0 $29578$da0feed9 @news.zen.co.uk ...[color=blue]
                          > Below is what my assignment involves, could you basically point me in the
                          > right direction to help me acomplish the task set but not give me the
                          > acctual answer.
                          >
                          > SCENARIO
                          > This assignment is based on a banking system. This mini bank will have 4
                          > customers. The customers each have 4 different accounts (Current Account,
                          > ISA Savings Account, Mortgage and Car Loan).
                          >
                          > Each customer should be represented as an array with 4 elements (Each
                          > element of the array will represent one of their accounts).
                          >
                          > Each customer aray should be an array of intergers. Therefore all amounts
                          > in the accounts are interger values.
                          >
                          > Your main program should allow the user to enter the initial amounts in
                          > each account for each customer and then selec from a menu in order to do
                          > the following tasks.
                          >
                          > 1.For a sepcific customer, display details of all their accounts.
                          > 2.Get the balance in an account for a specific customer.
                          > 3.Add to an account for a specific customer.
                          > 4. Withdraw from an account for a sepcified customer.
                          > 5.Get the total funds in all of the current accounts in the bank.
                          > 6.Get the total funds in all of the ISA's in the bank.
                          >
                          > You are to plan, design and impliment and test the mini banking system.[/color]

                          I'm assuming you know how to create methods.

                          You should create a method for each one of these six operations. For
                          now, just have them do something like print "This is option number 4.", and
                          then write the code for the menu system so that when the user selects an
                          item, the correct method is called (thus displaying the correct message).

                          From there, implement each method one by one.

                          This trick is known as "divide and conquer". That is, you divide the one
                          big problem into six smaller problems, and solve each smaller problem
                          individually. If the "smaller" problem is complicated, you can recursively
                          apply the same technqiue, and divide it again into even smaller problems
                          still.

                          - Oliver

                          Comment

                          • IchBin

                            #14
                            Re: Java Gurus Help

                            Oliver Wong wrote:[color=blue]
                            > "IchBin" <weconsul@ptd.n et> wrote in message
                            > news:08WdnaY0V-zw7I7ZUSdV9g@pt d.net...[color=green]
                            >> You threw me off before when you said a menu. Menu is a GUI object and
                            >> not command line displays.[/color]
                            >
                            > "Menu" is the name of a class in Java, and that's probably what you,
                            > IchBin, were thinking. But the term "menu" was also used back when
                            > computers only had text displays. They referred to exactly what Andrew
                            > is trying to implement: A list of options which could be selected by
                            > pressing the code (usually a single character long) associated with the
                            > desired option.
                            >
                            > So Andrew wasn't "incorrect" , but rather he was "ambiguous" .
                            >
                            > - Oliver[/color]
                            Thanks Oliver.. guess I forgot about the old days before I started
                            building GUI's on pc's in 1992.

                            --

                            Thanks in Advance...
                            IchBin, Pocono Lake, Pa, USA

                            _______________ _______________ _______________ _______________ ______________

                            'If there is one, Knowledge is the "Fountain of Youth"'
                            -William E. Taylor, Regular Guy (1952-)

                            Comment

                            Working...