See CHALLENGE
First, compile the code and create the .jar
file. To do that, in the project folder, in the terminal run:
javac -d galaxy-merchant/target/classes galaxy-merchant/src/main/java/galaxy/*.java
jar cvfm galaxy-merchant.jar Manifest.MF -C galaxy-merchant/target/classes/ .
In the terminal open the directory, where you put the .jar
file and run:
java -jar galaxy-merchant.jar
The program:
- accepts just the terrestrial Latin alphabet.
- accepts notes and questions in a specific order: it accepts "pish is X" but rejects "X is pish", it answers "how many Credits is glob Gold?" and does not know the answer for "how many Credits is Gold, glob?".
- is case sensitive: it accepts information "glob is I" but rejects "glob is i", it answers the question "how much is glob?" but not "How much is glob?". Therefore word "Credits" must be capitalized, roman numerals must be uppercase, rest of the text should be lowercase. Product names should be provided in the same pattern every time.
- expects a question mark at the end of a question.
- sanitizes input from extra whitespaces. It accepts "tegj is L" and " tegj is L ".
First, the program expects you to provide painstakingly collected notes.
Please provide a path to a file, by typing 'f:{path}' or provide a note in the console:
You can provide a file with notes and questions. The program will inform you if the file doesn't exist. It accepts a relative path.
f:/computer/wrong_path_to_the_file/test-input.txt
/computer/wrong_path_to_the_file/test-input.txt (No such file or directory)
f:test-input.txt
pish tegj glob glob is 42
glob prok Silver is 68 Credits
glob prok Gold is 57800 Credits
glob prok Iron is 782 Credits
I have no idea what you are talking about
The program will wait for the next questions until you type exit
.
how much is pish?
pish is 10
how many Credits is pish Silver?
pish Silver is 170 Credits
The program doesn't answer accurately for every question.
how do you do?
I have no idea what you are talking about
But it informs if it recognizes some misstatements.
how much is glob glob glob glob?
Invalid numeral
The program is case sensitive. It's very annoying and should definitely be improved in version 1.1:
How much is pish?
I have no idea what you are talking about