code
code
File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
generateRandomPassengers();
readPassengersIntoArray(passengers);
// Step 3: Print the total passengers for a specific day (e.g., column 2 =
Wednesday)
// Step 4: Print the day with the highest average number of passengers
highestAverage(passengers);
// Step 5: Calculate total sales between two days (e.g., from week 1,
Monday to week 3, Wednesday)
} catch (IOException e) {
e.printStackTrace();
if (scanner.hasNextInt()) {
passengers[i][j] = scanner.nextInt();
}
}
} catch (Exception e) {
e.printStackTrace();
int sum = 0;
sum += passengers[i][column];
return sum;
// Function to find the day with the highest average number of passengers
double maxAvg = 0;
maxAvg = average;
maxDay = col;
return days[day];
public static double salesCalculate(int[][] passengers, int row1, int col1, int
row2, int col2, double[] fees) {
double totalSales = 0;
for (int j = (i == row1 ? col1 : 0); j <= (i == row2 ? col2 : 6); j++) {
} else {
}
}
return totalSales;