Commit 819394aa authored by jinny.wilkin's avatar jinny.wilkin

Added comments

parent 6b7cad1f
No preview for this file type
...@@ -3,7 +3,7 @@ public class App { ...@@ -3,7 +3,7 @@ public class App {
/* Week 2 Exercises /* Week 2 Exercises
14/02 Jinny Wilkin */ 14/02 Jinny Wilkin */
int fingersOnRightHand = 5; // Ex 4.1 //int fingersOnRightHand = 5; // Ex 4.1
countDays(); // Ex 8.1 countDays(); // Ex 8.1
...@@ -145,7 +145,7 @@ public class App { ...@@ -145,7 +145,7 @@ public class App {
monthDo++; monthDo++;
}while(monthDo < 14); }while(monthDo < 14);
System.out.println("There are " + daysBetween(26, 8, 1996, 14, 2, 2022)); System.out.println("There have been " + daysBetween(26, 8, 1996, 14, 2, 2022)+ " days between the day I was born and the day I wrote this");
} }
...@@ -186,7 +186,7 @@ public class App { ...@@ -186,7 +186,7 @@ public class App {
} }
public static boolean isItALeapYear(int year){ public static boolean isItALeapYear(int year){ // Ex9
if(year % 4 == 0){ if(year % 4 == 0){
return(true); return(true);
}else{ }else{
...@@ -194,6 +194,8 @@ public class App { ...@@ -194,6 +194,8 @@ public class App {
} }
} }
// Ex 10
public static int daysInYear(int year){ public static int daysInYear(int year){
if(isItALeapYear(year)){ if(isItALeapYear(year)){
return(366); return(366);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment