HELP! no idea how to do this.. - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

HELP! no idea how to do this..

6410103064101030 Posts: 2Member
I just got this assignment..im in a basic programming class and am totally unprepared...does anyone know how to program this??



Create a page containing four image tags, two buttons, a and a . The images tags will each contain a picture of one of six possible outcomes for the dice portraying the numbers one through six..

The first button: When the user clicks on the button, all dice are rolled once. For each die when rolled, the src of its image tag is replaced with a random one of six possible pictures -- each picture being chosen with equal probability (1/6).

The select: The user may select any of the numbers one through six. Whenever a picture is clicked upon, then that die takes on the value shown inside the .

The textarea: Results of the dice rolls should be kept as a running log (a cumulative history) in a textarea at the bottom of the page. With each roll (initiated by the click of the button), we should be able to see the complete history of all current and previous dice rolls. You need not consider changes brought about clicks on individual dice in conjunction with the

The second button: A button below the textarea, should allow the user to obtain a report (overwriting the current contents of the log in the textarea) which tabulates the frequency of each of the six outcomes plotted separately for each of the dice. The frequency tabulation should show how often each die was rolled, as consistent with the data stored in the log.

Comments

  • MasterMind555MasterMind555 Posts: 3Member
    [italic]"...does anyone know how to program this??"[/italic]
    Yes

    Ok so, you'll need to make a JFrame with all what you listed there, then make the 6 pictures, and load them and store them into a variable.
    Then very easy, just an little help from the Random Class and you'll be good to go.



    --------------------------------------------------------
    Life is like a s**t sandwich, each day, you eat a good mouthful of it...
Sign In or Register to comment.