Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

In this program, you are going to write a program for playing the game of Hangman. In this game, the computer will pick a word and display a sequence of blanks to be filled in; one for each letter. The player will make guesses about what letters are in the word. If he/she guesses a letter that appears in the word, the appropriate blanks will be filled in. If the guess is a letter that doesn''t appear in the word, one part will be added to a figure hanging from a scaffold. When the hanging figure is complete (seven bad guesses), the game is lost.
Objectives:

* Write a GUI program
* Implement the ActionListener interface to handle Events
* Use arrays
You are to write the Hangman class (a driver class that creates the main window for this GUI program), HangmanPanel (a JPanel which contains all the components needed to run the program) and any other classes that you need to make this game work.

Specification:
* Hangman
o Your main class should create a JFrame and put a HangmanPanel in its content pane.
* HangmanPanel
o This class should extend JPanel and contain all the components needed for the user to play the game
+ The user should be able to start a new game and quit the program.
+ You need to provide components to display the letters that are are currently known as well as to allow the user to select a letter from the ones which have not yet been guessed.
+ You need a way to display the current state of the hanged man.
+ You will need at least one Listener class.
o When the game starts, the program should get a word from the WordList class (see below) and initialize the available letters and the blanks to be filled in. The words in this version of the game will all have eight letters in them.
* There should be no console output in this program
* All input to the program should be handled with components. JOptionPane dialogs should not be used for input.
* Handle all appropriate exceptions.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9502140

Have any Question?


Related Questions in Computer Engineering

Do research to identify three organizations that develop

Do research to identify three organizations that develop and operate e-commerce Web sites for their clients. Visit their Web sites and identify current job openings. What sort of responsibilities are associated with thes ...

We are evaluating a project that costs 1120000 has a

We are evaluating a project that costs $1,120,000, has a ten-year life, and has no salvage value. Assume that depreciation is straight-line to zero over the life of the project. Sales are projected at 64,000 units per ye ...

You are the senior consultant at abacus consulting tasked

You are the Senior Consultant at Abacus Consulting, tasked with the database project for Amadeus Real Estate client. The company employs real estate agents who work with customers to buy and sell properties (both residen ...

Pure gasoline has an energy density of 115600 btu per

Pure gasoline has an energy density of 115,600 BTU per gallon, while ethanol has an energy density of 75,670 BTU per gallon. Gasoline cost $3.70 per gallon. What would the price of E85 (85% ethanol, 15% gasoline) have to ...

The toronto blue jays raises ticket prices from 100 to 120

The Toronto Blue Jays raises ticket prices from $100 to $120 per seat and experience a decline in ticket sales from 12000 to 10000 per game. i) What is the elasticity of demand for tickets? ii) Assuming the marginal cost ...

Suppose a coworker approaches you and asks what an ethical

Suppose a coworker approaches you and asks what an ethical hacker does. She does not understand the role that an ethical hacker plays in the security industry and assumes that such a hacker intentionally causes damage. E ...

A five question multiple choice statistics quiz is given

A five question multiple choice statistics quiz is given. Each question has 3 possible choices, only one of which is correct. calculate the probability that of receiving a passing grade on the quiz, by randomly guessing ...

Describe the definition of ransomware and what is wannacry

Describe the definition of ransomware. And what is wannacry threat?

Suppose that the demand curve for tickets to see a football

Suppose that the demand curve for tickets to see a football team play a game is given by Q = 80,000 - 40P and marginal cost is zero. The team's stadium can host 75,000 fans. i) How many tickets would the team sell if it ...

Please discuss the data hazards associated with pipelining

Please discuss the data hazards associated with pipelining with an example and how these hazards impact the performance gain associated with pipelining.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As