473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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 )
Sep 4 '07 #1
8 1854
nickyeng
254 100+
why not you write some code first and show us....

breakfast in the morning wont be free tho.
Sep 4 '07 #2
r035198x
13,262 8TB
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
JosAH
11,448 Expert 8TB
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
r035198x
13,262 8TB
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
JosAH
11,448 Expert 8TB
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
3,112 Expert 2GB
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
JosAH
11,448 Expert 8TB
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
5,821 Expert 4TB
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

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

Similar topics

23
by: BlackHawke | last post by:
Hello! This is my second post. Ppl really helped me with the first. I hope there are answers for this one as well I own a game company (www.aepoxgames.net) releasing the beta for our first...
114
by: Maurice LING | last post by:
This may be a dumb thing to ask, but besides the penalty for dynamic typing, is there any other real reasons that Python is slower than Java? maurice
30
by: Mike Cox | last post by:
Hi. I recently ran a benchmark against two simple programs, one written in Java and the other in C++. The both accomplish the same thing, outputting "Hello World" on my screen. The C++ program...
1
by: =?Utf-8?B?S2Vubnk=?= | last post by:
I have one bat file that contains a command to startup Java Program. Then, I would like to create a cluster job to call the bat file. In case of one computer is down, another computer can also call...
6
by: aureao4 | last post by:
I'm new to Java and programming. I'm trying to code a payroll program and continue getting errors. The program worked last week, this week I have to add set, get and a class. I've written the class...
11
by: hamiltongreg | last post by:
I am new to Java and am having problems getting my program to compile correctly. My assignment is as follows; Choose a product that lends itself to an inventory (for example, products at your...
0
by: markthien | last post by:
Hi guys, I was trying to compile jasper report from java as below: public static void runReport(String databaseName, String userName, String password, String reportFile) {...
11
by: BigZero | last post by:
Hello, can i call Java method.That is java code from php,here what i m looking for i have class called DB in this class all the DB related things ,like DB connection DB insert,DB read etc...
63
by: s0suk3 | last post by:
I've been programming Python for a couple of years now. Now I'm looking to move on to either C++ or Java, but I'm not sure which. Which one do you think will be a better transition for a Python...
12
by: brey_maastricht | last post by:
Dear all, I'm trying to rewrite a Java program into C++. The Java programm works fast but I hoped that C++ would even be faster. But that is not the case ! (to be complete: both the Java and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.