Skip to content

Commit 6531876

Browse files
committed
added a lower difficulty problem
1 parent 61ebacd commit 6531876

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/com/codefortomorrow/intermediate/chapter11/practice/Methods.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
public class Methods {
44

5+
/**
6+
* Difficulty: 1
7+
*
8+
* Returns the average of two doubles
9+
* @param a the first double
10+
* @param b the second double
11+
* @return average
12+
*/
13+
public static double average(double a, double b) {
14+
return 0.0; //TODO: Fix!
15+
}
16+
517
/**
618
* Difficulty: 1
719
*

src/com/codefortomorrow/intermediate/chapter11/solutions/Methods.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
public class Methods {
44

5+
/**
6+
* Difficulty: 1
7+
*
8+
* Returns the average of two doubles
9+
* @param a the first double
10+
* @param b the second double
11+
* @return average
12+
*/
13+
public static double average(double a, double b) {
14+
return (a + b)/2;
15+
}
16+
517
/**
618
* Difficulty: 2
719
*

0 commit comments

Comments
 (0)