|
|
|
|
||
|
|
Static Methods |
|
||
|
|
Introduction In previous programs we have had to create an instance of a class to be able to use the methods of a class. However, this is not always required (as you have seen with the Math class or the Keyboard class. In this exercise you will create several static methods with a class and then create a client program to use those methods. |
|
||
|
|
Programming Assignment Write a program that creates a class of statistical methods e.g. mean, standard deviation and finding the median. Write the methods so that the data can be transferred to the methods in the form of an array. The methods should be declard static so that you do not have to create an instance of the class to use the methods. Create some data to test the methods. Turn in a program listing your source code. Source code should use proper formatting. Also turn in a copy of your output as in previous assignments. This can be obtained by running the program and then using AltPrintScreen to copy the window of the output onto the clipboard. Then paste the contents of the clipboard into WordPad and print out the document. In addition to the source code, the output, also turn in the answer to the questions listed below. |
|
||
|
|
|
|