-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEwokTesting.java
More file actions
35 lines (32 loc) · 809 Bytes
/
Copy pathEwokTesting.java
File metadata and controls
35 lines (32 loc) · 809 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
31
32
33
34
35
class EwokTesting
{
public static void main(String[] args)
{
// This code creates an array of Ewoks
Ewok[] ewoks = new Ewok[5];
for(int x=0; x<5; x++)
{
ewoks[x] = new Ewok();
}
System.out.println("Starting condition of the 5 Ewoks:");
for(int x=0; x<5; x++)
{
ewoks[x].printInfo();
}
ewoks[0].setName("Timmy");
ewoks[1].setName("Iffy");
ewoks[2].setName("Jimmy");
ewoks[3].setName("Bill");
ewoks[4].setName("Ewokian");
for(int x=0; x<5; x++)
{
int randomAge = (int)(Math.random() * 100);
ewoks[x].setAge(randomAge);
}
System.out.println("\n\nCondition of the 5 Ewoks after changes:");
for(int x=0; x<5; x++)
{
ewoks[x].printInfo();
}
}
}