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:
- Add a design and class diagram with your submission.
- Add comments to your code in FileIO class.
- Make sure you adequately test your code.
- 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:
- No errors, the program always works correctly and meets the specification(s) (2 points).
- User interface class is provided to interface with Sales Application (5 points) - Design for this provided in lecture.
- The code could be reused as a whole or each routine could be reused (2 points).
- Concepts of Array of Objects and Text File Input/Output are applied. (7 points)
- Java coding conventions are followed. (1 points).
- Code Readability (as suggested in class) (1 points).
- Adequately tested (unique test cases, covering boundary conditions) (1 points).
- 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
Step: 1
public class Store private float salesByWeek public Store salesByWeek new float57 public void setSal...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started