Correlation_Coefficient2

Correlation_Coefficient2 - The"Correlation_Coefficient2...

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

View Full Document Right Arrow Icon
// The "Correlation_Coefficient2" class. import apsc142.*; public class Correlation_Coefficient2 { public static void main (String [] args) { Correlation_Coefficient2 m = new Correlation_Coefficient2 (); C int MAXN = 50; int MaxX = 0, MaxY = 0, i = 0, h = 0; double temp = 0; d double xArray [] = new double [MAXN]; double yArray [] = new double [MAXN]; double sumX = 0, sumY = 0, sumXY = 0, sumXSquare = 0, sumYSquare = 0, meanX = 0, meanY = 0; double slope = 0, intercept = 0, r = 0; d FileIn inx = new FileIn ("C:/Peter/xvalues.txt"); FileIn iny = new FileIn ("C:/Peter/yvalues.txt"); F while (inx.readStatus != inx.EOF) { xArray [i++] = inx.readDouble (); } inx.close (); i MaxX = --i; M while (iny.readStatus != iny.EOF) { yArray [h++] = iny.readDouble (); } MaxY = --h; M iny.close (); i if (MaxX != MaxY) { System.out.println ("There is an unequal number of x and y values."); System.out.println ("The program will be terminated."); } else if (MaxX > MAXN) { System.out.println("The number of values exceed the maximum of " +MAXN);
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.

This note was uploaded on 12/01/2010 for the course APPLIED SC 142 taught by Professor Professorstansimmons during the Winter '10 term at Queens University.

Page1 / 2

Correlation_Coefficient2 - The"Correlation_Coefficient2...

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