A Sample program is provided. Make sure you understand this code as it will help you with your own programming for this assignment. Using the uncommented sample code for classes provided, answer the following questions:
1. Draw a UML diagram of the Shoe class using the code that has been provided. Complete this using the examples that have been provide in the lecture slides.
2. Draw a UML diagram of the Store class using the code that has been provided. Complete this using the examples that have been provide in the lecture slides.
3. Copy the code from Store.java into your report and appropriately comment the code. At a minimum, explain the purpose of each method. For the more complex methods reading input from a file, sorting the data and exporting data to the file, insert comments to explain the code.
4. Briefly explain the code in sortInventory. What is the inventory being sorted by? What is the sort algorithm that is being used. Explain in words how it works. Why do you need to use two for loops?
5. Briefly explain what other sorting algorithms could have been used.
6. What method of searching for shoes has been used in the program? What other algorithm could have been used.
7. Examine the lines to open the output file and write the outputString in the ShoeStore class:
File file = new File(“export.txt”);
output = new BufferedWriter(new FileWriter(file));
Where is the output file located? Find BufferedWriter in the Java API documentation and describe the use of this object.
8. Examine the code in the exportToFile method in the ShoeShop.java file. What is the purpose of the ‘\r\n’ in the toString() method that is used to produce the output string?