package control;

import boundary.*;
public class UC6Controller {

	public static void uc6() {
		int userInterval;
		do {
			SystemMenu.printUC6Menu();
			try {
				userInterval = Integer.valueOf((SystemMenu.getUserInput()));
			}
			catch (Exception e) {
				userInterval = -1;
			}
			if (userInterval <= 0) {
				System.err.println("Invalid input. Please try again.");
			}
		}
		while (userInterval <= 0);
		long userIntervalMinutes = userInterval * 1000; // in seconds
		userIntervalMinutes *= 60; // in minutes
		ECE567.timer.setInterval(userIntervalMinutes);
		System.out.println("Timer set for " + userInterval + " minute(s).");
		System.out.println("Timer starting...");
		ECE567.timer.startTimer();
	}
}
