dimanche 3 mai 2015

How to code the program to return to the code before if-else statement

If at the end of my program i want to ask the user if he wants to perform an operation again using a if-else statement

System.out.println("What Is The Length Of Side A In cm?");
sideA=read.nextDouble();

}

System.out.println("What Is The Length Of Side B In cm?");
sideB=read.nextDouble();

}

System.out.println("The Triangle Hypotenuse ="+Hypotenuse(sideA,sideB)+"cm");



System.out.println("Do you want to preform this operation again , answer  with yes or no "); 
  answer=input.next();
  if (answer.equals("no") || answer.equals("No"))
  repeat=false; 
  }else
continue; 
}

Now if i try to compile the code i get an error in the "continue" statement i am not sure how to make the program perform the operation again

Aucun commentaire:

Enregistrer un commentaire