package warmup1;

/*
 * Given an int n, return the absolute difference between n and 21, except 
 * return double the absolute difference if n is over 21. 
 * 
 * diff21(19) -> 2
 * diff21(10) -> 11
 * diff21(21) -> 0
 */

public class Diff21 {
	
	public static void main(String[] args) {
		Diff21 test = new Diff21();
		System.out.println(test.diff21(19));
		System.out.println(test.diff21(10));
		System.out.println(test.diff21(21));
	}
	
	public int diff21(int n) {
		  if (n <= 21) {
		    return 21 - n;
		  } else {
		    return (n - 21) * 2;
		  }
	}
}
@@ -167,16 +167,17 @@
 f21(19) 
+-
 -%3E 2%0A * 
@@ -187,16 +187,17 @@
 f21(10) 
+-
 -%3E 11%0A *
@@ -208,16 +208,17 @@
 f21(21) 
+-
 -%3E 0%0A */
@@ -555,8 +555,9 @@
   %7D%0A%09%7D%0A%7D
+%0A

Update Diff21.java