for Loop with Yes/No Question! help..please!
Wer i can put my next code if i press "Y" the program will proceed to the next day of loop and i can not enter Time in and Time out but if i Press "N".. i can continue enter Timein and Timeout then proceed to the next day of loop?
Please help!!!
This is my codes....
Code:
import java.io.*;
public class DayLoop
{
public static void main(String[]args) throws Exception
{
BufferedReader read = new BufferedReader (new InputStreamReader(System.in));
String empDays[] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday"};
String holiday="";
int tin=0,tout=0;
for (int cnt=0;cnt<empDays.length;cnt++)
{
System.out.println("=======================");
System.out.println("Today is " +empDays[cnt]);
System.out.println("=======================");
System.out.print("Is "+empDays[cnt]);
System.out.println(" a Holiday? Y/N");
holiday = read.readLine();
System.out.println("***********************");
System.out.println("Enter Time-in: ");
tin = Integer.parseInt(read.readLine());
System.out.println("Enter Time-out: ");
tout = Integer.parseInt(read.readLine());
}
}
}