GBIS710 - Project 1 - Specifications

This first project simulates something that might happen in a company that has existing Java applications. You are being asked to integrate some of your previous homework into this project and to write some new code. Be sure to read the Grading Approach at the end of this document. You may want to print this document.

Step 1. Write a new test driver called Class Project100. See Project100 specifications

Step 2. Take Class Date from Assignment 2 and verify that it works with Project100. See method dateTest().

Step 3. Take Parking from Assignment 3, modify it and integrate it into Project100. See method parkingTest().

Step 4. Take your Roll Dice from Assignment 4 and integrate it into Project 100. See method diceTest()

Step 5. Write new classes for the Shape Hierarchy. See Shape Hierarchy specifications

Step 6. Replace your dummy shapeTest() method with a real shapeTest method. See shapeTest specifications.

Step 7. Test everything together.(Project100,Dice,Parking,Date,TwoDimensionalShape,Circle,Square,ThreeDimensionalShape,Cube ,Sphere)

Step 8. Write a bat file named test100.bat that the instructor can run to compile ALL your classes and the run your Project100 driver. This bat file will consist of one javac statement for every .java file that should be compiled and one java statement (java Project100).

Step 9. Zip all you java files and your bat file into a single zip archive named Project100.zip. When the instructor runs your bat file it should successfully compile all your programs and run the test. If you are working on a non-Windows machine and cannot develop a bat file, send an email to your instructor during the first two weeks of this project.

Step 10. Unzip your archive into a clean (empty) folder. Run your bat file to verify that it works.

Step 11. Submit your zip archive to Blackboard.

Project 100 Specifications

You are to write a new Class called Project100. All input and output in this class is to be done using javax.swing.JoptionPane (See 14.3 in your textbook). Figure 14.2 has an example that will help. This is the class that contains your one and only main method.

Loop through the program multiple times until the user types Exit.

Display a dialog box asking the use to enter a test command. The user can enter Date or Parking or Dice or Shape or Exit.

If the user enters Exit, you should display a message and terminate the program.

If the user enters Date, you should call the method dateTest() in Class Project100

If the user enters Parking, you should call the method parkingTest() in ClassProject100

If the user enters Dice, you should call the method diceTest() in Class Project100

If the user enters Shape, you should call the method shapeTest() in Class Project100

Make sure your program handles multiple inputs. Do not quit after you process the first user input unless that input was Exit.

Write dummy methods for dateTest(), parkingTest(), diceTest() and shapeTest() that do nothing except Return. This will allow you to test your Project100 Class

Method dateTest()

Use your Class Date from Assignment 2. Feed it at least four dates -- two valid and two invalid. Display the results.

Method parkingTest()

Use your logic from Assignment 3. If you implemented Assignment 3 as a separate class, use that class and call it for testing. If you implemented Assignment 3 as method main, you should turn your Parking logic into a separate class (Class Parking) and then instantiate and call that class from Method parkingTest().. You are required to have at least four customers in your test. One customer that parks for 23 hours, one customer that parks for 4.5 hours, one customer that parks for 3.5 hours and one customer that parks for 1 hour. You must show for each customer at least the parking charge and the accumulated charges to date. For the first customer, the parking charge and the accumulated charges will be equal. Since you will be using a separate class, it is OK to use System.out to display results in Class Parking.

Method diceTest()

Use the logic that you wrote for Assignment 4 to show the results of your 36000 rolls. You output should look something like:

Sum Frequency Percentage
2 1006 2.79
3 2083 5.79
4 2935 8.15
5 3907 10.85
6 5128 14.24
7 5910 16.42
8 5044 14.01
9 3927 10.91
10 2989 8.30
11 2052 5.70
12 1019 2.83

You should turn your Assignment 4 code into a class (Class Dice) and then instantiate and call that class from this method. Remember that you Class Dice should not have a method main(String[] args)

Method shapeTest() - See shapeTest specifications

Shape Hierarchy Specifications

Create 7 classes. TwoDimensionShape and ThreeDimensionalShape inherit from Shape. Circle and Square Inherit from TwoDimensionalShape. Sphere and Cube Inherit from ThreeDimensionalShape.

Class Class Class Methods
Shape     getArea() abstract
      toString() abstract
      getVolume() abstract
  TwoDimensionalShape   getArea() abstract
      toString abstract
      getVolume() - provide a default value - return (float)0;
    Circle constructor Circle(float radius)
      getArea() - return float (calculate area of circle)
      toString() - return String "I am a circle"
    Square constructor Square(float side)
      getArea() - return float (calculate area of square)
      toString() - return String "I am a square"
  ThreeDimensionalShape   getVolume() abstract
      getArea() abstract
      toString() abstract
    Cube constructor Cube(float side)
      getArea() return float side*side*6
      getVolume() return float side*side*side
      toString() return String "I am a cube"
    Sphere constructor Sphere(float radius)
      getArea() return float 4*PI*r*r
      getVolume() return float (4/3)*PI*r*r*r
      toString return String "I am a Sphere"

 

shapeTest Specifications

Method shapeTest()

Create an array that will hold 8 object references. This array should be of type Shape.

Create 8 objects and store the reference for each of the 8 objects in your array. (Create two circles, two squares, two spheres, and two cubes. Use different values for each object that you create).

Loop through the array:

If the object is an instanceof a ThreeDimensionalShape, call the getArea, getVolume and toString methods on that object and display the results.

If the object is an instance of a TwoDimensionalShape, call the getArea and toString methods on that object and display the results.

GBIS710 - Project 1 - Grading Approach

Grading Steps

  1. Clear directory c:\javatest on my machine to remove all prior student work.
  2. Save zip file submitted by student into directory c:\javatest on my machine.
  3. Unzip the students Project100.zip file into c:\javatest.
  4. Type test100 to compile all the programs and start the test.
    1. Deduct one point if the names are other than Project100.zip and test100.bat
    2. Deduct five points if the bat file does not work for any reason and the student's test does not start automatically. The most common reasons for the test not starting will be programs that do not compile or progam names specified incorrectly in test100.bat or failure to list all programs to be compiled in the test100.bat file.
      1. Attempt to compile all the student's programs manually one at a time.
      2. For any program that did not compile, apply simple fixes it and charge five points per file fixed.
        1. Fix the programs in the order most favorable to the student. If the test driver(Project100.java) fails to compile because class Square did not compile, fix Square. Do not charge for the compile failure of the test driver (Project100.java) if fixing a subordinate class such as Square makes the problem go away.
        2. Keep fixing until everything compiles or it is determined that the fixes are not simple.
    3. If compile problems could not be corrected with simple fixes, give a grade as follows:
      1. Grade 60% if all classes and methods are present and the logic in all classes appears to be sound
      2. Grade 50% if all classes exist but the logic in some of them appears flawed
      3. Grade 0-40% if substantial code and/or entire files are missing (depending upon how much is missing)
      4. Go no further. No further grading is possible since the test cannot be executed.
  5. At this point, it is possible to run Project100 and the grade is guaranteed to be at least 60% no matter how many points have been deducted in the prior steps or will be deducted in the following steps.
  6. Run the test.
    1. Add many more details here
  7. Examine the code.
    1. Add many more details here
  8. Set the grade equal to 0-60% if the test could not be run
  9. Set the grade equal to max(60%, 60-sum of all points deducted).
  10. Post grade and comments with reasons for deductions on Blackboard.