Created
April 30, 2019 13:32
-
-
Save jbrains/47e8738bfd87851d0cd8c6041be0f86b to your computer and use it in GitHub Desktop.
Revisions
-
jbrains created this gist
Apr 30, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ package ca.jbrains.pos; import ca.jbrains.pos.ui.TextProcessorAndCommandInterpreter; import ca.jbrains.pos.ui.lcd.UdpPostOffice; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; public class VirtualPointOfSaleTerminal { public static void main(String[] args) throws IOException { TextProcessorAndCommandInterpreter textProcessorAndCommandInterpreter = new TextProcessorAndCommandInterpreter( new SaleController( new InMemoryCatalog( new HashMap<String, Price>() {{ put("12345", Price.cents(795)); put("23456", Price.cents(1250)); put("036000216066", Price.cents(379)); }} ), new EnglishLanguageTextDisplay( new UdpPostOffice("localhost", 5358, "UTF-8")) ) ); textProcessorAndCommandInterpreter.process( new InputStreamReader(System.in) ): } }