cst338 Final Designphase

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Eric Ybarra

CST 338: Software Design


9 August 2018
Program Spec

Create a Java program that includes a GUI in order to create a guessing game. The game must
have the following: general introduction to the game, input box for answer, at least three buttons,
Best score scoreboard and guesses used scoreboard.

Part 1: Main()
Create a class that has a main() that starts the game. It should include the name of the class for
part 2. Just like this
public class NAMEOFPROJECT
{
public static void main(String[] args)
{
NAMEOFCLASSPART2 variable = new NAMEOFCLASSPART2 ();
variable.MethodThatContainsJFrame();
}

Part 2: GUI Class


Packages needed: import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
This part of the program a JFrame is needed in order to build the GUI. Create a class and this
class needs a method in which the window such as the one below is created. Needs to include
three buttons. One for guessing, giving up and to let the user play again. Next in order to have a
random number generated there needs to be a random variable declared in the class
(Math.random() * 100). Also three action listeners are needed. Lastly having a count for the best
score overall and number of guesses used per game.

The output should look something like this

You might also like