Note that there are some explanatory texts on larger screens.

plurals
  1. POI am getting 3 illegal start of expression errors?
    text
    copied!<p>Please help me with this. I feel like this is really simple and I am probably going to feel really stupid when its all said and done. Thank You.</p> <p>I have tried multiple things but none seem to work. Yes, I am more familiar with Visual Basic than Java, that is why I am having this problem.</p> <pre><code> import java.util.Scanner; public class YuGiOhLifePointCounter { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { double choice_1; System.out.print("\nEnter the starting life points for player-1: "); choice_1 = sc.nextDouble(); double storage_1; storage_1 = choice_1; double choice_2; System.out.print("\nEnter the starting life points for player-2: "); choice_2 = sc.nextDouble(); double storage_2; storage_2 = choice_2; double lp; System.out.print("\nEnter a 6 to change the life-points of either player: "); lp = sc.nextDouble(); double display_1 = choice_1; double display_2 = choice_2; while (lp == 6) { /* Starting here*/ if (display_1 &lt;== 0) { System.out.println("Player-2 has won the game."); System.exit(0); } if (display_2 &lt;== 0) { System.out.println("Player-1 has won the game."); System.exit(0); } if (display_1 &lt;&gt; 0 &amp;&amp; display_2 &lt;&gt; 0) { /* these 3 if statements above are giving me illegal import errors, I can't figure out why. Thank You.*/ double choose_1_2; System.out.print("\nEnter a 1 to change player-1's life-points, or enter a 2 to change player-2's life-points: "); choose_1_2 = sc.nextDouble(); if (choose_1_2 == 1) { double ch_1; System.out.print("\nEnter the number subtracted from or added to player-1's life-points: "); ch_1 = sc.nextDouble(); double c_1; System.out.print("\nEnter a 1 to subtract this number from player-1's life-points, or enter a 2 to add this number to player-1's life-points: "); c_1 = sc.nextDouble(); if (c_1 == 1) { display_1 = storage_1 - ch_1; System.out.println("\nPlayer-1's life-points are currently " + display_1); } if (c_1 == 2) { display_1 = storage_1 + ch_1; System.out.println("\nPlayer-1's life-points are currently " + display_1); } } if (choose_1_2 == 2) { double ch_2; System.out.print("\nEnter the number subtracted from or added to player-2's life-points: "); ch_2 = sc.nextDouble(); double c_2; System.out.print("\nEnter a 1 to subtract this number from player-2's life-points, or enter a 2 to add this number to player-1's life-points: "); c_2 = sc.nextDouble(); if (c_2 == 1) { display_2 = storage_1 - ch_2; System.out.println("\nPlayer-2's life-points are currently " + display_2); } if (c_2 == 2) { display_2 = storage_1 + ch_2; System.out.println("\nPlayer-2's life-points are currently " + display_2); } } } } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload