Question: Write a program that opens the following text file and processes its contents. The program should display the following per store: The total sales for


Write a program that opens the following text file and processes its contents. The program should display the following per store:

  • The total sales for each week. (Should print 5 values - one for each week).
  • The average daily sales for each week. (Should print 5 values - one for each week).
  • The total sales for all the weeks. (Should print 1 value)
  • The average weekly sales. (Should print 1 value)
  • The week with the highest amount in sales. (Should print 1 week #)
  • The week with the lowest amount in sales. (Should print 1 week #)

The file contains the dollars amount of sales that a retail store made each day for a number of weeks. Each line in the file contains thirty five numbers, which are sales numbers for five weeks. The numbers are separated by space. Each line in the file represents a separate store.

Please make sure that you:

  1. Add a design and class diagram with your submission.
  2. Add comments to your code in FileIO class.
  3. Make sure you adequately test your code.
  4. Provide a user-friendly interface (Console based) in a separate class called UI.java

Submitting your work (24 Points)

Before submitting your work, please reflect on following points:

  1. No errors, the program always works correctly and meets the specification(s) (2 points).
  2. User interface class is provided to interface with Sales Application (5 points) - Design for this provided in lecture.
  3. The code could be reused as a whole or each routine could be reused (2 points).
  4. Concepts of Array of Objects and Text File Input/Output are applied. (7 points)
  5. Java coding conventions are followed. (1 points).
  6. Code Readability (as suggested in class) (1 points).
  7. Adequately tested (unique test cases, covering boundary conditions) (1 points).
  8. Class diagram is provided (UML usage is not required) (5 points).

Step by Step Solution

3.47 Rating (147 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public class Store private float salesByWeek public Store salesByWeek new float57 public void setSal... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!