i want java program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nirav Amin
    New Member
    • Sep 2007
    • 1

    #1

    i want java program

    Create a 2-D array containing the data :

    Pakistan Sweden France Iran China
    Japan Russia China Italy China
    China Japan Korea India Pakistan
    India China Egypt Lebanon Korea
    Australia N.Z. Sweden Vanuatu Korea
    Indonesia China Vietnam Russia New Guinea

    Create EITHER two 2-D arrays ( lose 1/ 2 mark ), or one 3-D array containing the data :

    7 4 0 1
    0 0 0 0
    0 1 1 2
    1 2 0 2
    0 2 6 1
    2 1 2 1

    1 1 2 0
    1 0 0 1
    0 1 1 1
    2 1 0 2
    0 1 1 3
    4 1 0 2

    The first column in the array of countries is the Home team in a Football match, and the other names are the teams which they played against, Game1, Game2, Game3 and Game4. The second array is Home team scores, and the third array is Away team scores.

    For example, Pakistan’s Game1 home match was against Sweden, and the score was 7-1 in Pakistan’s favour. When Pakistan played Iran in Game3, they lost 0-2.

    When Australia was at home to N.Z. in Game1 , it was a 0-0 draw. Australia beat Vanuatu 6-1 in Game3.



    Write a Java program to search these arrays.

    The user will enter the name of a Country, and also state which game ( 1, 2, 3 or 4 ).
    ( For example, Pakistan’s Game1 was a 2-1 win against Sweden ).

    In a second option, allow the user to enter the name of a Country. List all the Home matches and results for that Country.

    ( If the user enters China, the display will be
    Japan 0_0 Korea 1_1 India 1-1 Pakistan 2_1 )
  • nickyeng
    Contributor
    • Nov 2006
    • 252

    #2
    why not you write some code first and show us....

    breakfast in the morning wont be free tho.

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by Nirav Amin
      Create a 2-D array containing the data :

      Pakistan Sweden France Iran China
      Japan Russia China Italy China
      China Japan Korea India Pakistan
      India China Egypt Lebanon Korea
      Australia N.Z. Sweden Vanuatu Korea
      Indonesia China Vietnam Russia New Guinea

      Create EITHER two 2-D arrays ( lose 1/ 2 mark ), or one 3-D array containing the data :

      7 4 0 1
      0 0 0 0
      0 1 1 2
      1 2 0 2
      0 2 6 1
      2 1 2 1

      1 1 2 0
      1 0 0 1
      0 1 1 1
      2 1 0 2
      0 1 1 3
      4 1 0 2

      The first column in the array of countries is the Home team in a Football match, and the other names are the teams which they played against, Game1, Game2, Game3 and Game4. The second array is Home team scores, and the third array is Away team scores.

      For example, Pakistan’s Game1 home match was against Sweden, and the score was 7-1 in Pakistan’s favour. When Pakistan played Iran in Game3, they lost 0-2.

      When Australia was at home to N.Z. in Game1 , it was a 0-0 draw. Australia beat Vanuatu 6-1 in Game3.



      Write a Java program to search these arrays.

      The user will enter the name of a Country, and also state which game ( 1, 2, 3 or 4 ).
      ( For example, Pakistan’s Game1 was a 2-1 win against Sweden ).

      In a second option, allow the user to enter the name of a Country. List all the Home matches and results for that Country.

      ( If the user enters China, the display will be
      Japan 0_0 Korea 1_1 India 1-1 Pakistan 2_1 )
      Please read our posting guidelines.

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        I want a new laptop; and a more intelligent crew and a better legacy code base;
        and a cookie and a beer. (*)

        So there.

        kind regards,

        Jos

        (*) make that two beers.

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          Originally posted by JosAH
          I want a new laptop; and a more intelligent crew and a better legacy code base;
          and a cookie and a beer. (*)

          So there.

          kind regards,

          Jos

          (*) make that two beers.
          What's wrong with your three notebooks?

          Comment

          • JosAH
            Recognized Expert MVP
            • Mar 2007
            • 11453

            #6
            Originally posted by r035198x
            What's wrong with your three notebooks?
            My favourite one is getting old; I've been using it for three years now; it's been
            running for months continuously and the disk is starting to give hickups (bad
            sectors now and then). The keyboard is a mess but I still like that thingy;

            it has a 3GHZ single core AMD processor; but the periphernalia are about to die:
            the CD writer has been dead for more than a year now, the USB slots are worn
            out for no particular reason etc. etc. And when I keep it upside down I can roll
            a few more cigarettes from the tobacco falling out of the keyboard ;-)

            kind regards,

            Jos

            ps. and the 'down' key got stuck.

            Comment

            • Nepomuk
              Recognized Expert Specialist
              • Aug 2007
              • 3111

              #7
              Originally posted by JosAH
              My favourite one is getting old; I've been using it for three years now; it's been
              running for months continuously and the disk is starting to give hickups (bad
              sectors now and then). The keyboard is a mess but I still like that thingy;

              it has a 3GHZ single core AMD processor; but the periphernalia are about to die:
              the CD writer has been dead for more than a year now, the USB slots are worn
              out for no particular reason etc. etc...
              It's only 3 years old and already in that kind of state? Oh dear, how DID you treat the pour thing? For the last year I've been using a laptop, which was built in 1995, but it worked wonderfully! (Even the battery survived those years very well). I named him Jochen. OK, I didn't use Jochen permanently and I also have a Desktop (called Günther - he's not that much newer however!) but nevertheless... ^^

              Comment

              • JosAH
                Recognized Expert MVP
                • Mar 2007
                • 11453

                #8
                Originally posted by nepomuk
                It's only 3 years old and already in that kind of state? Oh dear, how DID you treat the pour thing? For the last year I've been using a laptop, which was built in 1995, but it worked wonderfully! (Even the battery survived those years very well). I named him Jochen. OK, I didn't use Jochen permanently and I also have a Desktop (called Günther - he's not that much newer however!) but nevertheless... ^^
                *only* three years old? I've been working on that thingy day after day for hours
                and hours; I even never switch it off. It is/was a great laptop; you should see
                my (two months old) Dell laptop: the keyboard is almost broken already.
                For my Acer laptop I already deducted all of it from my income tax; so it's a free
                laptop now ;-)

                Computer equipment needs to be sturdy; I still miss my old IBM keyboard and
                my (older) VT100 keyboard; you could *stand* on them; don't try that with those
                fragile laptop thingies.

                kind regards,

                Jos

                Comment

                • pbmods
                  Recognized Expert Expert
                  • Apr 2007
                  • 5821

                  #9
                  Oh yeah. I remember the first computer I ever painted. A 1998 Apple 'Wallstreet' G3.

                  Those things had a layer of metal underneath the rubber center... which looks fantastic set against a blue paint job :)

                  Comment

                  Working...