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, 22.06.2019 00:30
At an open or uncontrolled intersection, yield if a. the cross road has more lanes than yours b. the cross road has fewer land than yours c. you’re on a state highway and the cross road is a secondary road d. do you have three or more passengers in your vehicle
Answers: 2
question
Computers and Technology, 22.06.2019 07:00
For all machines-not just hammers- the user applies force force to the machine to the machine over a certain distance. a. input b. output c. duo d. none of the above
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
1. web and mobile applications allow users to be actively engaged in an online activity. a true b false 2. some examples of business applications purposes are to collaborate, share files, meet virtually in real-time, and accept payments. a true b false 3. an education application would most likely do which of the following? a allow users to watch popular movies and tv shows b connect users with social and business contacts c confirm users' travel plans d teach users a new language 4. a uniform resource locator (url) is how the internet knows where to take users when an address is typed into a browser. a true b false 5. deon is required to provide the citation information for his sources. what type of information should he collect from his sources? a author name, title, date of publication, date of access, url b connections to background information c interesting facts and statistics d notes on important information
Answers: 1
question
Computers and Technology, 24.06.2019 18:00
Hacer un algoritmo que me permita ingresar el nombre de una parcela de terreno y muestre junto al mensaje “tipo de suelos: suelos fumíferos, ¡excelente!
Answers: 1
You know the right answer?
Write a program that opens the salesdat. txt file and processes it contents. The program should disp...
Questions
question
Geography, 03.07.2019 23:00
Questions on the website: 13722359