GBIS710 - Project 2 - Specifications

Click Refresh (F5) to make sure you have the latest version of this page

In this project, you are going to write three independent classes.

Step 1. Write class TriangleDisplay() -- (10 points)

Step 2. Write class FileReverse() -- (20 points)

Step 3. Write class SliderDemo() -- (10 points)

Step 4. Compile and Test all your classes. (5 points). Your should write a test driver named Class Project200. This class should contain your main method.

Step 5. Zip all you java files and your bat file into a single zip archive named Project200.zip.(5 points)

Step 6. Submit your zip archive to Blackboard.

Step 7. Watch videos after December 8 ( 10 points)

 

TriangleDisplay specifications:

Write an application that displays five randomly generated triangles in different colors.
Each triangle shold be filled with a different color.
Use class GeneralPath and moethod fill of class Graphics 2D to draw the triangles.

FileReverse specifications

Write a program that inputs a file named prj2.txt and uses a stack to display the words in the file in reverse order.
Store file prj2.txt in the same directory as your java source code and class files
Display the results any way you want.
The above will get you 15 points of out the 20 possible points
Next, enhance your program so that is does not display any punctuation marks
Build an array of punctuation marks to be excluded and then use this array.
This will earn you the final 5 points.

SliderDemo specifications:

Write a program that uses the paintComponent method to draw the current value of a Jslider on a subclass on Jpanel.
In addition, provide a JTextField where a specific value can be entered.
The JTextField should display the current value of the JSlider at all times.
Changing the value in the JTextField should also update the JSlider.
A JLabel shuld be used to identify the JTextField.
The JSlider methods setValue and getValue should be used
Note: The setValue method is a public method that does not return a value and takes one integer argument, the JSlider value, which determines the position of the thumb.

Project200 Test Driver specifications:

Use a class name of Project200 and a file name of Project200.java
Create a Scanner
Invoke TriangleDisplay

Read a line using the Scanner you created. This will pause your program to allow you to check results.When the operator of the program presses Enter, the program will continue.

Invoke FileReverse
Read a blank line
Invoke SliderDemo
Read a blank line
Exit

 

Bat file specifications:

Create a text file named Project200.bat. Compile all your programs and then run your test driver. Here is what I expect. (Note: If there are any bugs in my code, it is your job to remove them before you submit your work).

javac TriangleDisplay.java
javac FileReverse.java
javac SliderDemo.java
javac Project200.java
java Project200