the System.out.print("\n\n\t\t Do you want to see the next record ? [y/n]");
keeps repeating and repeating how can i stop it when the Records becomes 0.
case 3: //Previous
if (recno!=0) {
String pre;
System.out.print("\n\n\t\t\t\t Previous Record");
System.out.print("\n\n\t\t\t Employee Number: EMP-"+EmpNo[recno]);
System.out.print("\n\t\t\t Employee Name: "+EmpName[recno]);
System.out.print("\n\t\t\t Salary: "+Salary[recno]);
System.out.print("\n\t_________________________________________________________________");
do {
System.out.print("\n\n\t\t Do you want to see the next record ? [y/n]");
pre = reader.readLine();
if(pre.equals("y")) {
recno--;
System.out.print("\n\n\t\t\t Employee Number: EMP-"+EmpNo[recno]);
System.out.print("\n\t\t\t Employee Name: "+EmpName[recno]);
System.out.print("\n\t\t\t Salary: "+Salary[recno]);
}
menu = display.charAt(0);
System.out.print("\n\t_________________________________________________________________");
} while(menu=='n');
System.out.println("Thank You for Using this Program!");
}
else {
System.out.print("\n\n\t\t\t\tRecord Not Found!");
}
break;