Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

public class Store private float salesByWeek public Store salesByWeek new float57 public void setSal... 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

Starting Out With Java From Control Structures Through Data Structures

Authors: Tony Gaddis

6th Edition

0133957055, 978-0133957051

More Books

Students also viewed these Programming questions

Question

What is encapsulation?

Answered: 1 week ago

Question

What does it mean to append data to a file?

Answered: 1 week ago