Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a new BlueJ Project called: SalesReadProject Copy the sales.txt file from Blackboard into the SalesReadProject Folder. Create a new Class called SalesReadWrite. This is

Create a new BlueJ Project called: SalesReadProject

Copy the sales.txt file from Blackboard into the SalesReadProject Folder.

Create a new Class called SalesReadWrite. This is your main() program.

The SalesReadWrite main() will do the following:

Prompt the user using Scanner to Enter name of sales file to read: .

Read the name of the file entered on keyboard by user.

Open the file (name provided from keyboard, you saved in filename variable) to READ from it using File and Scanner.

In a loop (what type of loop will you choose) Read all the numbers from the file while calculating:

the smallest sale in the entire file.

the largest sale in the entire file.

the total number of sales in file.

NOTE: you will need a variable to keep track of each of these.

When the loop has terminated because it reached the end of the file:

CLOSE the file.

Print TO TERMINAL:

Opening SalesRpt.txt to write output...

Open the SalesRpt.txt file to WRITE to it using PrintWriter.

Print the following TO FILE (SalesRpt.txt):

Number of sales in file: XX

Smallest sale in file: XX.XX

Largest sale in file: XX.XX

After printing To File.CLOSE the file.

Print TO TERMINAL:

Print Done writing to SalesRpt.txt to Terminal.

Print Open up SalesRpt.txt to view output. to Terminal

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

Online Systems For Physicians And Medical Professionals How To Use And Access Databases

Authors: Harley Bjelland

1st Edition

1878487442, 9781878487445

Students also viewed these Databases questions

Question

=+country competitive advantages? Why? Support your point of view.

Answered: 1 week ago

Question

=+from: a) a MNEs perspective? and b) the HRM managers perspective?

Answered: 1 week ago