JMU
logoArchetypes.png
ArchRival


Introduction

Purpose: The main class for (a prototype of) the ArchRival system.

This class must construct ScoreBoard objects for two different events, set-up the ScoreBoard objects, iteratively prompt the user to enter information about divers/dives at the two events, and display that information on the appropriate ScoreBoard.

Attributes
Static Attributes:
This class must have (and use appropriately) the following static attributes.
    public static ScoreBoard       jmu, stanford;    
  

These attributes are public and static to facilitate Web-CAT testing.

Details
Setup:
During the "setup phase", this class must:
  1. Construct the ScoreBoard named jmu with a title of "JMU Invitational" and 7 judges.
  2. Set the ad to display on the left side of this jmu to "DukeDashAd.png".
  3. Set the ad to display on the right side of jmu to "WeatherBitsAd.png".
  4. Start the ScoreBoard named jmu.
  5. Construct the ScoreBoard named stanford with a title of "Stanford Dual Meet" and 4 judges.
  6. Set the ad to display on the left side of stanford to "JMUAd.png".
  7. Set the ad to display on the right side of stanford to "HarrisonburgAd.png".
  8. Start the ScoreBoard named stanford.
Iterations:
After the "startup phase", this class must iteratively prompt the user (on System.out) to enter the following information (in order):
  1. "Event:"
  2. "Name:"
  3. "Dive:"
  4. "Scores:"
  5. "Continue?"

You may assume that the user will always respond appropriately (on System.in) to any given prompt. The appropriate responses follow.

  • In response to the "Event:" prompt, the user will respond with either "JMU" or "Stanford".
  • In response to the "Name:" prompt the user will enter the diver's name (specifically, the driver's family name followed by a space, followed by the diver's personal name).
  • In response to the "Dive:" prompt the user will enter a space-delimited description of a dive as follows:

    group half-somersaults half-twists position

    The group will be "1" for a forward dive, "2" for a backward dive, "3" for a reverse dive, and "4" for an inward dive. half-somersaults and half-twists will be a String representation of an int value (e.g., 7 half-somersaults for a dive with 3 1/2 somersaults). The position will be either "A" for straight, "B" for pike, "C" for tuck, and "D" for free.

    Note that this version of the system will not support flying dives. Hence, all dives must be assumed to be non-flying.

  • In response to the "Scores:" prompt the user will enter a space-delimited list of judges scores (which will be String representations of a double-value with or without a decimal point).
  • In response to the "Continue?" prompt the user will enter either "Y" or "N".

Based on the user's responses to these prompts, it must modify the appropriate ScoreBoard object as requested. That is, the response to the "Event:" prompt must be used to select a particular ScoreBoard. The responses to the "Dive:" prompt must be used to construct a Dive object. The responses to the "Name:" and "Scores:" prompts must be used, along with the Dive object, to change what is displayed on the appropriate ScoreBoard (by calling the showScore() method). Obviously, since this method must also be passed a total score, the response to the "Scores:" prompt must also be used (along with the ScoreCalculator class) to calculate the total score.

This process must continue until the user does not enter "Y" in response to the "Continue?" prompt.

Shutdown:
After the "iteration phase" terminates, this class must call the shutdown() method of the two ScoreBoard objects.

Copyright 2013