forked from Yandex-Practicum/Java-Module-Project-YP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
30 lines (28 loc) · 843 Bytes
/
Main.java
File metadata and controls
30 lines (28 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.util.ArrayList;
public class Main {
public Main() {
}
public static void main(String[] args) {
ArrayList<Race> carList = new ArrayList<>();
Race race = new Race();
int[] arrayI = new int[3];
String[] arrayS = new String[3];
for(int i = 0;i <3;i++ )
{
carList.add(new Race());
}
for(int i = 0; i<3;i++)
{
System.out.println("Введите название машины номер " + (i+1) + " и её скорость:");
carList.get(i).setCar();
}
for(int i = 0; i<3;i++)
{
arrayS[i] = carList.get(i).returnName();
}
for(int i = 0; i<3;i++) {
arrayI[i] = carList.get(i).returnSpeed();
}
race.getWinner(arrayI, arrayS);
}
}