Last of 4 screens for java console program: A company hires you to write a progr
ID: 3560593 • Letter: L
Question
Last of 4 screens for java console program:
A company hires you to write a program to track hourly employee arrival and departure times from work. In essence, you are tasked to make an online time clock. The time clock shall keep a history of an employee
Explanation / Answer
public class Clear{ public static void main(String[] args){ if(isWindows()){ //Windows }else if(isMac()){ //Mac }else if(isLinux()){ //Linux }else{ System.out.println("Your OS is not support!!"); } } public static boolean isWindows(){ String os = System.getProperty("os.name").toLowerCase(); return (os.indexOf("win") >= 0); } public static boolean isMac(){ String os = System.getProperty("os.name").toLowerCase(); return (os.indexOf("mac") >= 0); } public static boolean isUnix(){ String os = System.getProperty("os.name").toLowerCase(); return (os.indexOf("linux") >=0); } }
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.