subject

Write a program that opens the salesdat. txt file and processes it 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 number are separated by space. Each line in the file represents a separate store.
//FileIO. java
import java. io. BufferedReader;
import java. io. FileReader;
import java. io. IOException;
public class FileIO {
//Franchise readData(String filename)
public static void main(String[] args) {
try {
FileReader file = new FileReader("Salesdat. txt");
BufferedReader buff = new BufferedReader(file);
boolean eof = false;
while (!eof) {
String line = buff. readLine();
if (line == null)
eof = true;
else
System. out. println(line);
}
buff. close();
} catch (IOException e) {
System. out. println("Error -- " + e. toString());
}
}
}
//Store. java
public class Store {
private float salesbyweek[][];
Store() {
salesbyweek = new float[5][7];
}
//getter and setters
//(int week, int day, float sale)
public void (int week, int day, float sale){
salesbyweek[week][day]=sale;
}
//float [] getsalesforentireweek(int week)
//float (int week, int day)
//businessmethod
//a. totalsalesforweek
//b. avgsalesforweek
//c. totalsalesforallweeks
//d. averageweeklysales
//e. weekwithhighestsaleamt
//f. weekwithlowestsaleamt
//analyzeresults //call a through f
//print()
}
//Franchise. java
public class Franchise {
private Store stores[];
public Franchise(int num) {
stores = new Store[num];
}
public Store getStores(int i) {
return stores[i];
}
public void setStores(Store stores, int i) {
this. stores[i] = stores;
}
}
//Driver. java
public class Driver {
public static void main(String[] args) {
}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 04:31
Type the correct answer in the box. spell all words correctly. the managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
What type of slide show is a dynamic and eye-catching way to familiarize potential customers with what your company has to offer? a. ole b. photo album c. brochure d. office clipboard
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Idon’t understand the double8 coding problem. it is java
Answers: 1
question
Computers and Technology, 24.06.2019 15:30
What type of forensic evidence was recovered during the bomb set off at the new mexico facility on the video that was similar to the evidence obtained at the boston bombings and how did the evidence allow the researchers to connect other pieces of evidence to the same bomb?
Answers: 2
You know the right answer?
Write a program that opens the salesdat. txt file and processes it contents. The program should disp...
Questions
question
Chemistry, 07.10.2019 03:10
question
Mathematics, 07.10.2019 03:10
Questions on the website: 13722363