import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
public class BestPlayers {
public static void main(String[] args) throws FileNotFoundException {
ArrayList players = new ArrayList<>();
var hankeesData = new Scanner(new File("Hankees.txt"));
Player player;
for (int num = 0; num < 9; num++) {
player = new Player(hankeesData.nextLine(), hankeesData.nextDouble());
hankeesData.nextLine();
players.add(player);
}
for (int num = 0; num < 9; num++) {
player = players.get(num);
if (player.getAverage() >= 0.100) {
System.out.println(player.getName() + " " + player.getAverageString());
}
}
}
}
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
ArrayList list = new ArrayList<>();
list.add(85);
list.add(19);
list.add(0);
list.add(103);
list.add(13);
int largest = Integer.MIN_VALUE;
for (Integer i : list) {
if (i > largest) {
largest = i;
}
}
System.out.println(largest);
}
}
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
ArrayList words = new ArrayList<>();
words.add("cat");
words.add("dog");
words.add("horse");
words.add("zebra");
Scanner keyboard = new Scanner(System.in);
String newWord = keyboard.next();
int i = 0;
while (i < words.size() && newWord.compareToIgnoreCase(words.get(i)) > 0) {
i++;
}
words.add(i, newWord);
for (String string : words) {
System.out.println(string);
}
keyboard.close();
}
}