im having trouble figuring out why its giving me a syntax error
package DamageCalc; import java.util.Scanner; public class DmgCalc { public static void main (String[] args) { int attack,element; boolean retry; boolean yes = true; String weak = "Your Damage against your weak element is "; Scanner input = new Scanner(System.in); do { System.out.println("Enter your Attack"); attack = input.nextInt(); System.out.println("What is your Element? (Use 1-4) 1-Fire 2-Water 3-Earth 4-Wind"); element = input.nextInt(); if(attack == 0) { System.out.println("Your damage is 0."); }else{ switch(element) { case 1: attack =(int)((attack * 1.4 + 0 - 2 * 0.98) * 1.6); System.out.println(weak + attack); break; case 2: attack =(int)((attack * 1.4 + 0 - 2 * 0.98) * 1.3); System.out.println(weak + attack); break; case 3: attack =(int)((attack * 1.4 + 0 - 2 * 0.98) * 1.4); System.out.println(weak + attack); break; case 4: element =(int)((attack * 1.4 + 0 - 2 * 0.98) * 1.3); System.out.println(weak + attack); break; default: System.out.println("Exiting...Please follow directions."); break; } System.out.println("Would you like to try another calculation?"); retry = input.nextBoolean(); } while (retry = yes); } } }
and the error i get is
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Syntax error, insert "while ( Expression ) ;" to complete DoStatement
at DamageCalc.DmgCalc.main(DmgCalc.java:47)
i dont understand because on the line above it i have the while ()
the part im trying to add is the do while loop the rest of the code without it works nice i tried to set retry as string boolean int lol
im really not sure if im doing this right though im all confused right now lol any help would be great