Assignment5a - / The "Assignment3" class....

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// The "Assignment3" class. /*Emilie Courtemanche Simon Wu Section O Section O 459 7274 454 5302 /*This program shows the ability to use methods and two dimensional arrays to make complicated calculations that would be extremely difficult.*/ m import apsc142.*; public class Assignment5a { private static int totlRows = 10; //declaring size or array that can be used in any method private static int totlCols = 10; //declaring size of array that can be used in any method public static double abs(double a, double b){//Math.abs didn't work so created it double greater, lesser; if(a > b){ greater = a; lesser = b; } else{ greater = b; lesser = a; } return greater - lesser; }//this is where the absolute function ends, didn't comment a lot because should've worked by itself s public static void initialize (double matT[][]){//this is the method to put initial values into matrix for(int x = 0; x < 10; x++){//here is a set of double for loops (x,y) being counters for(int y = 0; y < 10; y++){// double for loops allow us to access componets
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Assignment5a - / The &quot;Assignment3&quot; class....

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online