Below is the code Im working with. I am trying to round up. The code is running fine but I just cannot figure out how to round up. I've tried a few thing but they all cause errors
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class weeklytemps {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
ArrayList<String> Day = new ArrayList(
Arrays.asList("Monday", "Tuesday", "Wednesday", "Thurday", "Friday", "Saturday",
"Sunday"));
ArrayList Temperature = new ArrayList(Arrays.asList(72, 75, 83, 94, 48, 89, 71));
System.out.print("Please enter a day of the week or enter 'week' for each days temperature:");
Scanner sc = new Scanner(System.in);
String Dayinput = sc.next();
if (Dayinput.equalsIgnoreCase("week") || Dayinput.equalsIgnoreCase("Week")) {
int average=0;
System.out.println("Days of the week and Temperatures for each day");
for (int i = 0; i < Day.size(); i++) {
average=average+(Integer)Temperature.get(i);
System.out.println(Day.get(i) + " " + "-" + " " + Temperature.get(i));
}
System.out.println("Average temparature: "+(average/7.0));
} else {
System.out.println("Day of week and Temperature of the day ");
for (int i = 0; i < Day.size(); i++) {
if (Day.get(i).equalsIgnoreCase(Dayinput))
System.out.println(Day.get(i) + " " + Temperature.get(i));
}
}
}
}