Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java I need to fix the first program correctly Write a program named HW4CreateInventory.java to store shoe data into an inventory data file. Ask

in java I need to fix the first program correctly

image text in transcribed
Write a program named HW4CreateInventory.java to store shoe data into an "inventory" data file. Ask the user to enter the name of the file to store the information into. If the file exists, ask the user if they want to append to the file, erase the existing data from the file, or use a different file. Handle the user's choice appropriately. Then, repeat until the user is done entering shoe data, capture the shoe number, purpose (casual, dress, or athletic) and the four factor values (price, comfort, look, and function) for each pair of shoes. (This program would be something that the shoe store clerk would run, as they enter new shoes into inventory or that would be captured by the store, based on online reviews from customers.) b. Write a second program named HW4ShoeAdvisor.java to ask the user for a purpose, and ask the user to set their weight preferences. (Verify that the weight preferences adds up to 10). Then read the inventory data file, and output the best pair of shoes for that purpose, using the user's weight preferences. Repeat until the user is ready to quit. Sample data is shown below. Assume we are only interested in the three purposes shown. Shoes 1-3 are the sample shoes described above. (This program would be ran by a customer looking for a pair of shoes.) Sample User's Weight Preferences: 3 2 2 Sample shoes in inventory: Shoe Using the sample weights, Number Purpose Price Comfort | Look Function calculated shoe rating 1 casual 3 5 5 34 2 casua 5 2 5 3 40 3 casual 5 4 3 31 4 dress 4 5 4 4 42 5 athletic 2 4 5 2 33 6 dress 3 5 4 5 41 7 athletic 5 4 3 5 42 8 dress 5 3 4 3 39 Use JFileChooser for choosing the filename. Output your name as part of the output. To make this a useable solution in real-life: What additional data would you need? What additional questions would you need answered? What are additional modifications would you need to make? Include your answers to these questions in your heading documentation of the second program. Bonus: Ask the user if he/she wants to use the default weights (the same as Emily's weights), or set their own weights. Then, continue with the shoe advisor appropriately. Validate the purpose of the shoe meets one of the three listed. More Bonus: Incorporate additional factors into your solution that would aid its value in a real-life situation. In the heading documentation explain what problem your bonus is focused on solving and how your implementation solves it. More Bonus: Using a different problem domain, answer the questions above and solve the problem. For example, how would you: rank football teams? Decide which car to purchase? Decide which school to attend

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions