mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Display the order the boats finished in
- Added a function in the App class to display the order in which the boats finished the race #implement
This commit is contained in:
@@ -1,9 +1,32 @@
|
||||
package seng302;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class App
|
||||
{
|
||||
/*
|
||||
Displays the order in which the boats finished
|
||||
|
||||
@param race The current race
|
||||
*/
|
||||
public static void displayFinishingOrder(Race race){
|
||||
int numberOfBoats = race.getNumberOfBoats();
|
||||
Boat[] boats = race.getFinishedBoats();
|
||||
|
||||
System.out.println("--- Finishing Order ---");
|
||||
|
||||
for (int i = 0; i < numberOfBoats; i++) {
|
||||
System.out.println("#" + Integer.toString(i+1) + " - " + boats[i].getTeamName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static void main( String[] args )
|
||||
{
|
||||
System.out.println("");
|
||||
Race race = new Race();
|
||||
|
||||
displayFinishingOrder(race);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user