summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormokha <mokha@cisco.com>2019-05-05 18:01:28 -0600
committermokha <mokha@cisco.com>2019-05-05 18:01:28 -0600
commit170305c72002b9e18e3cd62361efbfc07618739d (patch)
tree8e1011a88a824417c27be3c51272a081315b6479
parentb1bb5110174be171454e24128f6e5fb64db52a4d (diff)
start to write tests for existing TaxReturn code.
-rw-r--r--assignments/assignment1/README.md9
-rw-r--r--assignments/assignment1/src/main/java/ca/mokhan/assignment1/TaxReturn.java2
-rw-r--r--assignments/assignment1/src/test/java/ca/mokhan/assignment1/TaxReturnTest.java19
3 files changed, 28 insertions, 2 deletions
diff --git a/assignments/assignment1/README.md b/assignments/assignment1/README.md
index 68a39f0..c090240 100644
--- a/assignments/assignment1/README.md
+++ b/assignments/assignment1/README.md
@@ -234,6 +234,11 @@ If the total of a number (x) and its subsequent number (x+1) is a value divisibl
If the number is prime, print “prime”.
10. Modify the following program to the specifications given below:
-Add a new status – SingleParent – where the tax is computed as a SINGLE but with a further reduction of $5000 per child.
-Add a new tax condition – if the income is greater than $249,999 for SINGLE, then add a tax of 25% on income amount above $150,000; if the income is greater than $349,999 for MARRIED, then add a tax of 35% on income amount above $200,000.
+
+* Add a new status –
+ SingleParent – where the tax is computed as a SINGLE but with a further reduction of $5000 per child.
+* Add a new tax condition –
+ if the income is greater than $249,999 for SINGLE, then add a tax of 25% on income amount above $150,000;
+ if the income is greater than $349,999 for MARRIED, then add a tax of 35% on income amount above $200,000.
+
Unknown status – if the status doesn’t belong to SINGLE or MARRIED or SINGLE_PARENT, then compute a 33% tax on the income.
diff --git a/assignments/assignment1/src/main/java/ca/mokhan/assignment1/TaxReturn.java b/assignments/assignment1/src/main/java/ca/mokhan/assignment1/TaxReturn.java
index 18aa28e..9137268 100644
--- a/assignments/assignment1/src/main/java/ca/mokhan/assignment1/TaxReturn.java
+++ b/assignments/assignment1/src/main/java/ca/mokhan/assignment1/TaxReturn.java
@@ -1,3 +1,5 @@
+package ca.mokhan.assignment1;
+
import java.util.Scanner;
public class TaxReturn {
diff --git a/assignments/assignment1/src/test/java/ca/mokhan/assignment1/TaxReturnTest.java b/assignments/assignment1/src/test/java/ca/mokhan/assignment1/TaxReturnTest.java
new file mode 100644
index 0000000..2322700
--- /dev/null
+++ b/assignments/assignment1/src/test/java/ca/mokhan/assignment1/TaxReturnTest.java
@@ -0,0 +1,19 @@
+package ca.mokhan.assignment1;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class TaxReturnTest extends TestCase {
+ public TaxReturnTest(String testName) {
+ super(testName);
+ }
+
+ public static Test suite() {
+ return new TestSuite(TaxReturnTest.class);
+ }
+
+ public void testTrue() {
+ assertTrue(true);
+ }
+}