This project contains the solution (implemented in Java language) for the Sales Taxes problem which can be viewed at this link.
-
Java JDK >=8. Not the JRE
Ensure that the
java
command is in the PATH and is using version 8. For example:> java -version java version "1.8.0_66" Java(TM) SE Runtime Environment (build 1.8.0_66-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
If the kernel cannot start, with an error along the lines of
Exception in thread "main" java.lang.NoClassDefFoundError: jdk/jshell/JShellException ... Caused by: java.lang.ClassNotFoundException: jdk.jshell.JShellException ...
then double check that
java
is referring to the command for thejdk
and not thejre
. -
Ensure that the
ant
command is in the PATH. For example:> ant -version Apache Ant(TM) version 1.10.1"
-
Clone this repo.
> git clone https://gitlab.com/tiziano92/sales-taxes-problem.git
-
Go into the project's folder.
> cd sales-taxes-problem
-
Compile the project.
> ant compile
-
Run the program
> ant execute.TestRunner
./src
├── entities
│ ├── Good.java
│ ├── ImportedGood.java
│ ├── NonImportedGood.java
│ ├── Receipt.java
│ ├── ShoppingBasket.java
├── exceptions
│ ├── GoodNotFoundException.java
│ ├── ShoppingBasketNotFoundException.java
├── good_types
│ ├── GoodType.java
├── helper
│ ├── Helper.java
├── interfaces
│ ├── GoodInterface.java
│ ├── ReceiptInterface.java
│ ├── ShoppingBasketInterface.java
├── test
├── ReceiptJUnit.java
├── TestRunner.java
├── result.txt
6 directories, 15 files