Question: Code Review Without executing the code, checks the syntax of the code, coding standards, code optimization, etc and propose a solution for that. Part #1

Code Review Without executing the code, checks the syntax of the code, coding standards, code optimization, etc and propose a solution for that.

Part #1 public static int LONG_WORD_LENGTH = 5; public static String longestWord; public static void countLongWords(List words) { n = 0 longestWord = "" for (String word: words) { if (word.length() > LONG_WORD_LENGTH) ++n; if (word.length() > longestWord.length()) longestWord = word; } System.out.println(n); } }

Part #2 public static boolean leap(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) true; else false; }else{ if (tmp.charAt(2) == 0 && tmp.charAt(3) == 0) { false; } if (tmp.charAt(3)==0||tmp.charAt(3)==4||tmp.charAt(3)== 8) true; } false; }

please answer fast as possible

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!