Prog that takes in a string and returns the sum of its digits according to set parameters
Download a copy into your local computer
You need to have java installed
Once java is installed, run :
javac MyProg.java
this will build the MyProg class
To run ,
java MyProg
To test compile the Testing class
javac Testing.java
To run tests after compilation is successful,
java Testing
the testing class has different methods to enable testing. Each method has comments that explain functionality
testProgSystemIn(String line, String input,String expOut,String name)
testProg(String line, String expRes, String testName)
testErr(String line, String expRes,String testName)
To add custom test, please use these methods in the main function in the testing class
- -f file.txt --> takes in a file path after the parameter
- -x --> sets the hex flag so that digits are evaluated in hex
Program will indicate if arguments are not set correctly / if there are any alien arguments
- Java
- Jie Shen Ong