By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,492 Members | 1,289 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,492 IT Pros & Developers. It's quick & easy.

i want java program

P: 1
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 )
Sep 4 '07 #1
Share this Question
Share on Google+
8 Replies


100+
P: 254
why not you write some code first and show us....

breakfast in the morning wont be free tho.
Sep 4 '07 #2

10K+
P: 13,264
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.
Sep 4 '07 #3

Expert 10K+
P: 11,448
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.
Sep 4 '07 #4

10K+
P: 13,264
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?
Sep 4 '07 #5

Expert 10K+
P: 11,448
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.
Sep 4 '07 #6

Nepomuk
Expert 2.5K+
P: 3,112
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... ^^
Sep 4 '07 #7

Expert 10K+
P: 11,448
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
Sep 4 '07 #8

pbmods
Expert 5K+
P: 5,821
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 :)
Sep 4 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.