I'm getting confused with this do while
statement. I want to make if the user input y
then it will loop back to do
loop. I'm not sure how to command back to do
loop since C++
you can use goto
keyword if I'm not mistaken.
do
{
System.out.print( "\nPlease Make A Choice :");
input = stdin.readLine();
x = Integer.parseInt(input);
if (x == 1)
CalculateCircleArea.GetRadius();
else if (x == 2)
CalculateRectangleArea.GetLengthAndHeight();
else if (x == 3)
CalculateTriangleArea.GetHeightBaseAndBaseLength();
else
System.out.print("\t WRONG INPUT");
String input2;
String abc = "\n\tDO YOU WANT TO CONTINUE?";
String abc2 = "\n\t PLEASE CHOOSE (Y/N):";
String abc3 = abc.concat(abc2);
System.out.print(abc3);
input2 = stdin.readLine();
}while (choice == 'y');