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 17:20
What is the best assassins creed game?
Answers: 2
question
Computers and Technology, 24.06.2019 13:20
In the insert table dialog box, you select the checkbox to create the first row as the header of the table.
Answers: 3
question
Computers and Technology, 24.06.2019 23:30
What is the opening page of a website called? a. web page b. landing page c. homepage d. opening page
Answers: 1
question
Computers and Technology, 25.06.2019 06:50
Write a program that will askthe user to enter the amount of a purchase. the program should thencompute the state and county sales tax. assume the state sales tax is4 percent and the county sales tax is 2 percent. the program should displaythe amount of the purchase, the state tax, the county sales tax, the total salestax, and the total of the sale. (which is the sum of theamount of purchase plus the total sales tax). hint: use the value 0.02 torepresent 2 percent, and 0.04 to represent 4 percent.
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
Mathematics, 06.04.2021 21:50
question
Computers and Technology, 06.04.2021 21:50
question
Computers and Technology, 06.04.2021 21:50
question
Mathematics, 06.04.2021 21:50
question
Chemistry, 06.04.2021 21:50