object-oriented java 2 home > crash testing specs

CIT-244 Interface project specs

bookProject specification


Java provides plentiful tools for simulating real-world events by designing Objects whose members reflect critical outcome variables of interest. For example, in this project, we are modeling a NHTSA-designed vehicle crash test and generating scaled double value between 0 and 5 to represent the crash outcome.

Solidify your Vehicle class hierarchy

Generate an abstract class at the root of your hierarchy to represent a generalized vehicle. Then create one or more concrete subclasses which represent a specific make and model of vehicle. Include sensible member variables to describe the auto, pushing all generalizable qualities which apply to all autmobiles to the superclass.

Implement CrashTestable interface

  1. Study Liang 9 chapter 15 on interfaces.
  2. Clone our CIT-130 & CIT-244 combined repository into a known location on your hard drive. Remember to use git to do so.
  3. In NetBeans, connect your existing project (in which you're designing your Vehicle hiearcy) to our shared repository. Do this inside NetBeans by right clicking your project >> properties >> libraries >> add project then click Add Project and select the location of the cloned repo.
  4. Implement the CrashTestable interface that is inside of our java OO shared repo. Implement all required methods using logic that is appropriate to your particular subclass which is doing the implementing. Some of these values can be hardcoded.

Design a client class that simulates the vehicle crash

Create a class named to your choosing which contains your program's main method, instantiates your sublcass, and displays to the user basic data about your classes.

At this early stage in design, your program doesn't need to interact with the user yet, unless you'd like to.

Most importantly, design a method that simulates crash testing the vehicle. Demonstrate that your code generates a variable (but not random) test output that generally centers around a computed value based on the values returned from your CrashTestable interface methods.

Design your own method called something like crash which accepts a CrashTestable object and returns a double value (which your javadoc should specify spans from 0 to 5).

Propose a CrashTester interface

Your vehicle subclass which implements CrashTestable currently simulate the crashing does so in its own specific way. An interface allows other programmers to write Classes that conform to your specification and allow reuse of your code.

Once your method correctly simulates the crashing of a car, extract your method's signature and include it in an interface.

Document, diagram, and push

Create java doc comments to accompany EACH of your methods. Review the java doc doc for more information.

Study this guide called All The UML You Need To Know and create a UML class diagram for all classes in your package. Be sure to carefully include each member variable in each class in your diagrams. Consider the easyUML plugin in NetBeans or draw.io for creating your diagram.

Finally merge your changes in git to your master branch, push your master to github.com, and create a readme.md file using this master markdown guide describing what your code does, includes an image of your UML diagram, and explains HOW to run your code to the user.

arrow_upward top

Page created in 2019 and can be freely reproduced according to the site's copyleft use agreement.