Homework: Map


This homework is necessary preparation for the lab. Make sure you type your answers in a file you bring to the lab so that you will be able to quickly copy and paste them into the file provided in the lab.

Software Originals, Inc., has been hired by Eaton Wright, the "pizza king", to help automate a new chain of pizza delivery stores. SOI's system engineering staff have asked you to implement a prototype for the telephone operator's console. To start the project they have assigned you to implement the following two static methods (the first of which will be used to read files containing menus of pizza sizes and their prices, and pizza toppings and their prices; and the second of which will be used to read the first order from a file containing pizza orders whose total prices are to be calculated). They haven't had time to write formal specifications; hence the informal nature of the descriptions.

  1. Implement the static method getPriceMap declared as follows:

    You may find some String methods (e.g., substring(int, int) and indexOf(char)) as well as the Integer class parseInt(String) static method to be useful in coding this method.

  2. Implement the static method getOneOrder declared as follows: