File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
src/ExamsExercises/MidExams_06 Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,15 @@ public static void main(String[] args) {
99 int [] pirateShip = Arrays .stream (scanner .nextLine ().split (">" ))
1010 .mapToInt (Integer ::parseInt )
1111 .toArray ();
12+
1213 int [] warShip = Arrays .stream (scanner .nextLine ().split (">" ))
1314 .mapToInt (Integer ::parseInt )
1415 .toArray ();
16+
1517 int maxHealth = Integer .parseInt (scanner .nextLine ());
1618 String commandLine = scanner .nextLine ();
1719 boolean end = false ;
20+
1821 while (!commandLine .equals ("Retire" ) && !(end )) {
1922 String command = commandLine .split (" " )[0 ];
2023 if (command .equals ("Status" )) {
@@ -69,6 +72,7 @@ public static void main(String[] args) {
6972 commandLine = scanner .nextLine ();
7073 }
7174 }
75+
7276 if (!end ){
7377 System .out .printf ("Pirate ship status: %d%n" , getStatus (pirateShip ));
7478 System .out .printf ("Warship status: %d%n" , getStatus (warShip ));
You can’t perform that action at this time.
0 commit comments