I would say add an if statement right before the end of the do-while loop.


if(loop == 9)
{
System.out.println("Do you want to go again?\nYes or No";
Scanner scan = new...