Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two-dimensional arrays??

Status
Not open for further replies.

JohnZ

Technical User
Sep 1, 2000
2
0
0
US
Here's the problem: Each team in a six-team soccer league played each other team once. See table below. Write a program to

a) Place the team names in a one-dimensional array.
b) Place the data from the table in a two-dimensional array.
c) Place the number of games won by each team in a one-dimsional array.
d) Display a listing of the teams giving each team's name an number of games won. The list should be in decreasing order by the number of wins.
_______________________________________________________________________
Jazz Jets Owls Rams Cubs Zips
Jazz ----- Jazz Jazz Rams Cubs Jazz
Jets Jazz ----- Jets Jets Cubs Zips
Owls Jazz Jets ----- Rams Owls Owls
Rams Rams Jets Jets ------ Rams Rams
Cubs Cubs Cubs Owls Rams ----- Cubs
Zips Jazz Zips Owls Rams Cubs -----
_______________________________________________________________________
PLEASE HELP!

THANKS

 
Some hints:
1. Use the 1-D array as your primary source
2. Now esablish the 2-D array using the previous
3. Since the teams only play each other once you will effectively only use half the array
4. Make one dimention Dominant (i.e. the winner) Now you want toi set three values - not played (Null); won(Yes/1); lost(No/0) with the result referring to the team listed on the dominant dimension.
Thereafter do some array arithmetic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top