Programming Project #6 GUI - Graphing and Line Fitting Distributed: 11/25/2014 Due: 12/11/2014 Write a Java GUI that will accept up to 10 data values (x- and y-coordinate), display the values as a graph. Give the user the power to fit a straight line to the data points. Specifics: (1) The GUI will have 10 X 2 input fields that cill accept data values. (2) The GUI has the following buttons: - Clear fields: all input fields will be cleared of values. The graph (see below) is cleared. - Initialize x: Initialize the x fields with 0, 1, 2, ... 9. This is intended to simplify user entry, where the x values are indexes to a 1D array of values (which are the y values). - Generate sample data: the values from the quadratic equation y = 0.5 * x^2 + 2*x for x = 0, 1, 2, ..., 9 will be used to fill the input fields. This button is intended for testing and demonstration purposes. - Generate graph: using the input field values, generate an appropriately scaled 2D graph. The data points will be indicated with a graphics object ( e.g., oval or rectangle) or a character ('*', "#", 'o'). Programmer's choice as to the actual mark made for data points. - Fit a line: draw the line that fits the data according to least squares method ( http://hotmath.com/hotmath_help/topics/line-of-best-fit.html ). Do not erase the current graph when your program draws the fitted line. (3) The GUI has a field used for the 2D graphical display of the points. The actual layout is left to your judgement. Note, the user does not need to supply the number of data points to the program. If there are fewer than 10 data points, the program should be able to handle that by examining the data values. You may assume that the data points are entered from the top-most (left-most) fields and there are no empty fields within the list the data values. Extra credit for added functionality: - Let user choose color of data points and fitted lines - Let user choose mark for data points. - Let user change the maximum number of data pairs (e.g., to 20). - ... Grade based on: Meets specs: 75% Coding style, elegance: 15% Demo, walk-thru, OTF changes: 10%