import java.io.IOException; import java.io.PrintWriter; public class Hotplate { /**This program calculates the heat distribution on a hotplate with boundary conditions given. * @param args * @throws IOException */ public static void main(String[] args) throws IOException { // TODO Auto-generated method stub //initilize numbers of rows and columns final int rows = 20; final int columns = 20; //set initial conditions final double topTemperature = 100; final double bottomTemperature = 100; final double leftTemperature = 0; final double rightTemperature = 0; //create hotplate matrix double[][] hotplate = new double[rows][columns]; //iterate through top and bottom rows and make equal to top and bottom initial conditions for(int i=1; i tolerance) { //after while loop starts make reset largest difference to 0 largestDifference = 0; //iterate through rows excluding the first and last for (int i=1; i largestDifference) { largestDifference = Math.abs(newTemperatureValue - oldTemperatureValue); } } } //print out largest difference for user to see System.out.println(largestDifference); } //return the new hotplate data return hotplate; } /**this method prints the hotplate matrix for the user * @param int rows, int columns, double[][] hotplate */ public static void printToScreen(int rows, int columns, double[][] hotplate) { //iterate through every row and column and print out each value for(int i=0; i