import components.map.Map; import components.map.Map1L; import components.simplereader.SimpleReader; import components.simplereader.SimpleReader1L; import components.simplewriter.SimpleWriter; import components.simplewriter.SimpleWriter1L; /** * Simple pizza order manager: inputs orders from a file and computes and * displays the total price for each order. * * @author Put your name here * */ public final class PizzaOrderManager { /** * Private constructor so this utility class cannot be instantiated. */ private PizzaOrderManager() { } /** * Inputs a "menu" of words (items) and their prices from the given file and * stores them in the given {@code Map}. * * @param fileName * the name of the input file * @param priceMap * the word -> price map * @replaces priceMap * @requires
* [file named fileName exists but is not open, and has the * format of one "word" (unique in the file) and one price (in cents) * per line, with word and price separated by ','; the "word" may * contain whitespace but not ','] ** @ensures [priceMap contains word -> price mapping from file fileName] */ private static void getPriceMap(String fileName, Map
* input.is_open and * [input.content begins with a pizza order consisting of a size * (something defined in sizePriceMap) on the first line, followed * by zero or more toppings (something defined in toppingPriceMap) * each on a separate line, followed by an empty line] ** @ensures
* input.is_open and * #input.content = [one pizza order (as described * in the requires clause)] * input.content and * getOneOrder = [total price (in cents) of that pizza order] **/ private static int getOneOrder(SimpleReader input, Map
* output.is_open and * output.content = #output.content * * [display of price, where price is in cents but * display is formatted in dollars and cents] **/ private static void putPrice(SimpleWriter output, int price) { assert output != null : "Violation of: output is not null"; assert output.isOpen() : "Violation of: output.is_open"; assert 0 <= price : "Violation of: 0 <= price"; // TODO - fill in body } /** * Main method. * * @param args * the command line arguments */ public static void main(String[] args) { SimpleReader in = new SimpleReader1L("data/orders.txt"); SimpleWriter out = new SimpleWriter1L(); Map