APPLIED SC
Assignment5a

# Assignment5a - The"Assignment3 class*Emilie Courtemanche...

• Notes
• 2

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

// 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 of 2 dim arrays if(x == 0 || x == totlRows - 1 || y == 0 || y == totlCols - 1)

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

This is the end of the preview. Sign up to access the rest of the document.
• Winter '10
• ProfessorStanSimmons
• Array, private static int, static int totlCols, acceptable int counter

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern