School of Engineering and Applied Science
Department of Computer Science
CSci 53 -- Introduction to Software Development 
http://www.seas.gwu.edu/~csci53/spring05
Prof. Michael B. Feldman 
mfeldman@gwu.edu


Project 7
Due Date: 5 PM, Wednesday, May 4, 2005
FINAL DEADLINE FOR ALL PROJECTS! NO projects can be accepted after this date.
Submit to EJ's mailbox in the CS Department office; ask secretary to time stamp your project.

The goal of this project is to develop some methods in a class, and to use them in an application program.

Project:

In this project you will write some methods to do simple statistical operations on a partially-filled array of integer data.

Part 1:

Copy and compile the class SimpleStats.java; you will see that most of the methods are stubbed out; in this part of the project you will complete the stubbed methods. Test your methods using a simple test program; instead of bothering to read the data interactively, your test program can "hard-wire" the data just by initializing an array and sending it to the methods.
 
All these methods are public static; none of them write any output to the console. In each case, numbers is the array that holds the integer values and howMany indicates how many values are present. The class also contains a private method, SelectionSort, which is fully coded and can be used by other methods (like median).

  /**
  * Returns smallest value in array  
  */
  public static int minimum (int[] numbers, int howMany)
 
  /**
  * Returns largest value in array  
  */
  public static int maximum (int[] numbers, int howMany)
 
  /**
  * Returns average of values in array  
  */
  public static double average (int[] numbers, int howMany)

  /**
  * Returns median of values in array  
  */
  public static double median (int[] numbers, int howMany)

Part 2:

In this part of the project, you'll build a menu-driven application that uses the methods of the class. As a starting point, copy, compile, and run the file SimpleUI.java. You can then modify it to meet this project's requirements. The menu selections will be

R - read up to 12 integers from the keyboard
M - compute and display the minimum value
X - compute and display the maximum value
V - compute and display the average value
D - compute and display the median value
Q - quit

What to submit

You must follow the process given in Systematic Software Development and the sample project packet distributed in class.

Your grade will be calculated on a 20-point basis, as follows:

MBF 4/19/05