Analyse the quality of the Java codes below public static boolean leap(int y) { String tmp =
Fantastic news! We've Found the answer you've been seeking!
Question:
Analyse the quality of the Java codes below
public static boolean leap(int y) { String tmp = String.valueOf(y); if (tmp.charAt(2) == '1' || tmp.charAt(2) == '3' || tmp.charAt(2) == 5 || tmp.charAt(2) == '7' || tmp.charAt(2) == '9') { if (tmp.charAt(3)=='2'||tmp.charAt(3)=='6') return true; /*R1*/ else return false; /*R2*/ }else{ if (tmp.charAt(2) == '0' && tmp.charAt(3) == '0') { return false; /*R3*/ } if (tmp.charAt(3)=='0'||tmp.charAt(3)=='4'||tmp.charAt(3)=='8')ret urn true; /*R4*/ } return false; /*R5*/ }
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date: