Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 29th, 2007, 11:16 PM
thename1000 thename1000 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Posts: 2 thename1000 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 20 sec
Reputation Power: 0
Please help...Playoffs of 8 teams?

Hi,

I'm writing a program which takes the ranks and names (user input) of 8 teams and decides a winner through 3 rounds of playoffs. Now the winner of each round is decided by their rank (higher rank wins). I'm having trouble putting this into the program.

So far I have(output):

Input team 1's name: [print this]
Team 1 [enter this]
Input team 1's ranking: [print this]
90.4 [enter this]
etc.

But I need to display this after what I have:

Round 1 Teams:
----------------
Team 1 90.4
Team 2 81.6
Team 3 88.9
Team 4 90.2
Team 5 83.9
Team 6 79.9
Team 7 80.7
Team 8 88.8

Round 2 Teams:
----------------
Team 1 90.4
Team 4 90.2
Team 5 83.9
Team 8 88.8

Round 3 Teams:
----------------
Team 1 90.4
Team 8 88.8

Winner:
----------------
Team 1 90.4

Now I can get the first round output with this code:


System.out.println("\n\nRound 1 Teams:\n--------------");

for (Team team : teams) {

System.out.println(">>> " + team);

}

}

}



class Team {

private String name;

private double rank;



public Team(String name, double rank) {

this.name = name;

this.rank = rank;

}


public String toString() {
return String.format("%s %.1f", this.name, this.rank);


}

}

But the other rounds...? I don' t know.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Please help...Playoffs of 8 teams?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT