Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

First answer received inclluded using BreezySwing Package. Still using TextPad a

ID: 3534072 • Letter: F

Question

First answer received inclluded using BreezySwing Package. Still using TextPad and would not compile without additional work.please see the following: I will award points to the one I feel best meets the teachers requirements. May not necessarily be the first response. I would rather have quality for the result.


Teacher has given following project: Due next Wednesday latest

.Write a Java program that will use a Graphical User Interface (GUI) to present 10 addition questions to

the user, prompt for and read the user's answer, give the user feedback, and keep track of how many

questions the user got correct. After all 10 questions are presented, the program should tell the user

the total number of questions answered correctly.

Guidelines:

1) The program must be implemented as a GUI, not a command line program.

2) Each addition exercise presented should display 2 randomly generated integers. The numbers

should be NON-ZERO. Otherwise, you may determine the appropriate range for these numbers

(1 to 10, 10 to 20, 5 to 50, etc.) The numbers may be generated using the Random class or using

the random method in the Math class.

3) If the user enters the wrong answer, the program should tell them the correct answer;

if the user enters the right answer, the program should tell them they are correct.

4) After the program gives feedback on the user's answer, the user should be able to proceed to

the next question by pressing a button. This feature will allow the user to read the feedback at

his/her leisure, and only receive the next question when (s)he is ready.

5) After all 10 questions are finished, the program should display a summary ofthe user's

performance (number correct out of 10.) This summary should remain visible until the user

closes the program.

6) The user should not be able to interact with components of the interface at inappropriate times.

For instance, the button to proceed to the next question should not be available when the user

has not yet answered the current question.

7) The program should include one "special feature" not described above. Possible features are:

../ Display two or more images (.jpg or .gif) at different times during the program to

accompany feedback and/or instructions to the user .

../ Display a panel with your own picture constructed with Java graphics components .

../ Include a "Show Me" button which allows the user to see the answer to the question

without attempting it first. If the user selects "Show Me" the answer will be displayed

and they will be able to proceed to the next question. The user will not get credit for

answering that question correctly .

../ Some other special feature, if approved by the instructor in advance.

8) Your program source code should be well-formatted (indentations, spacing, etc.)

9) Your program source code should contain appropriate comments, detailing at a minimum

../ Program/class name

../ Author

../ Date

../ Purpose of program and purpose of individual class(es)

../ Purpose of each section of the program or class

10) Submit all files to the Project folder in the course Dropbox. These include your main

program (.java file only), all custom classes (.java files only), and any graphics (.jpg or .gif).

She has indicate the following two files can be used as templates:

_____________________________________________________________-

!st file:

import java.awt.*;

import javax.swing.JPanel;


public class Magic8GraphicPanel extends JPanel

{

//------------

//Constructor

//------------


public Magic8GraphicPanel()

{

setBackground(Color.orange);

setPreferredSize(new Dimension(100,100));

setFont(new Font("Arial", Font.BOLD, 30));

}



//*************************************************************

// Paint Component method paints the graphics page

//*************************************************************


public void paintComponent(Graphics page)

{

super.paintComponent(page);


page.setColor(Color.black);

page.fillOval(10,10,80,80);


page.setColor(Color.red);

page.fillOval(20,20,60,60);


page.setColor(Color.black);

page.fillOval(25,25,50,50);


page.setColor(Color.white);

page.drawString("8",42,60);

}


}

------------------------------------------------------------------------------------------------------

And second file is :

import javax.swing.JFrame;


public class Magic8GUI

{

public static void main (String[] args)

{

//Set up frame (the window in which the program will display)

JFrame myFrame = new JFrame("Magic 8 Ball");

myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);


//Add custom panel to frame as content pane

Magic8MainPanel mainPanel = new Magic8MainPanel();

myFrame.getContentPane().add(mainPanel);


//Finalize and display the window

myFrame.pack();

myFrame.setVisible(true);


}

}

Explanation / Answer

may be this will help to u..static class Program