Write a method heading for each method

Assignment Help JAVA Programming
Reference no: EM13188155

Consider a class that could be used to play a game of hangman. The class has the following attributes:

  • The secret word
  • The disguised word, in which each unknown letter in the secret word is replaced with a question mark (?). For example, if the secret word is abracadabra, and the letters a , and b have been guessed, the disguised word would be ab?a?a?ab?a
  • The number of guesses made
  • The number of incorrect guesses

It will have the following methods:

  • MakeGuess(c) guesses that character c is in the word
  • getDisguisedWord returns a string containing correctly guessed letters in their correct positions and unknown letters replaced with ?
  • getSecretWord returns the secret word
  • getGuessCount returns the number of guesses made
  • isFound returns true if the hidden word has been discovered.

Perform the following actions:

  • Write a method heading for each method.
  • Write preconditions and postconditions for each method.
  • Write some Java statements that test the class.
  • Implement the class.
  • List any additional methods and attributes needed in the implementation that were not listed in the original design. List any other changes made to the original design.
  • Write a program that implements the game of handgman, using the class you wrote for part d.

Reference no: EM13188155

Questions Cloud

State entire system to warm to room temperature : Liquid helium at 4.2 K has a density of 0.147 g/mL. Suppose that a 1.00-L metal bottle that contains air at 98K and 2.0 atm pressure is sealed off. If we inject 60.0 mL of liquid helium and allow the entire system to warm to room temperature
Explain the solar system model : In a simplified and example version of the solar system model (developed by Neils Bohr, a Danish chemist), an electron in the first orbit has an energy of 2 J
Information security breaches : What special consequences do you foresee from information security breaches confined to online retail banking compared to online commercial banking?
Compute the detection limit for a single measurement : Calculate the detection limit (90% and 95% confidence interval) for a single measurement. Use the equation D.L = (ks)/m
Write a method heading for each method : Write a method heading for each method, write preconditions and postconditions for each method.
Explain a structure unambiguously : The following label was found on a bottle of liquid hydrocarbons in the laboratory of Dr. Ima Turkey following his disappearance under mysterious circumstances. Although the name defines a structure unambiguously
Was the price decrease caused by shift in supply or demand : The lumber industry was hit hard by the sub prime mortgage turmoil in 2008. Prices plunged fro m $290 per thousand board feet to less than $200 per thousand board fee t. Many observers bel ieved this p rice decrease was caused by the slowing of ne..
Estimate the relative error in the calculated surface area : Estimate the relative error in the calculated surface area.
Write a program to test your class definition : Do not define an input method. The only method that can set the counter is the one that sets it to zero. Write a program to test your class definition.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Enterprise java beans (ejb) in software development

Enterprise Java Beans (EJB) in software development, EJB technology, EJB application, Stateless Session Beans (SLSB), Stateful Session Beans (SFSB), Message Driven Bean (MDB), Entity Bean

  Requests 2 numbers from the user and then passes

Write a program in java that requests 2 numbers from the user and then passes these 2 numbers to a method findMax that displays the largest number. Make sure your method is called fron main(). Test the method by passing various data to it

  Java application prompt user to put in integer from keyboard

Write a java application that performs the following task: prompt user to put in an integer from the keyboard, search for the user input from the array created in step 1.

  Write a program that shows the current time and date

Write a program that shows the current time and date

  Create system in java using agile approach

You are a software manager in company which designs critical control software for aircraft. Create system in Java using agile approach with a user involved in the development team.

  Create javascript program to find gross pay for employees

Create JavaScript program which will find out the gross pay for each of three employees. Company pays "straight time" for first 40 hours worked by each employee and pays "time and a half".

  Teaching software componentization

Describe one way in which one could apply Java graphics in education. Provide one example of such use to support your response and analyze at least three commands that you would use in order to draw a bar chart. Provide a rationale for your respons..

  Bilinear and nearest neighbour algorithm in java

How to do bilinear and nearest neighbour algorithm in java. Show how to eliminate change in pixel aspect ratio in java.

  Graphicsframe class

This program makes use of the GraphicsFrame class and the Drawable interface. Your missions is to create the class Airplane. Each Airplane object should store the following information (fields): manufacturer modelNumber maximumSpeed // in knots maxim..

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Write java program to utilizes gui with five text fields

Write down the program called MaxMinAvgGUI.java which utilizes GUI with five(5)text fields which asks user to enter 5(five) decimal numbers. 1(one)number in each text field.

  How many numbers do you want to enter

Write a program that asks the user "How many numbers do you want to enter?" With that value, create an array that is big enough to hold that amount of numbers (integers).

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd