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

  World data app

Prepare WorldDataApp project. It implements the NameIndex portion, including creating it in SetupProgram, and searching, viewing and updating it in UserApp program.

  Be sure to show all declarations

Write a function call that invokes function a. Be sure to show all declarations. However a complete main is not required.

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Application that generates a quiz

Create an application that generates a quiz. Prompt for the user's first and last name, college major, and confidence in test taking (high, medium, or low). The quiz should contain at least five true/false questions about horticulture. When the user ..

  The program should ask the user to enter the student'' answer

Your program should store these correct answers in an array. (Store each question's correct answer in an element of a string array.) the program should ask the user to enter the student's answers for each of the 20 questions, which should be stored i..

  Design and implement an applet called circles

Design and implement an applet called Circles that draws 50 circles of random diameter in random locations. If the diameter of a circle is less than a certain value, the circle is ?lled with the color yellow.

  Create a deque class based on the discussion of deques

Create a Deque class based on the discussion of deques (double-ended queues) in this chapter. It should include insertLeft(), insertRight(), removeLeft(), removeRight(), isEmpty(), and isFull() methods.

  Structure named dog with a string field

Create a Structure named dog with a string field for the Dog's name. Create a Structure named Cat with a string field for the Cat's name. Write a program that declares one Dog and one Cat, and assign names to them. Write two overloaded functions n..

  Write a program to read a file and encode

Write a program to read a file and encode the file to an encrypted file. And write a program to get an encrypted file and decode to original file. Your program should prompt the user to enter an input file name and an output file name

  Design a single class that expresses the commonality

Design a single class that expresses the commonality of these concepts.

  Write a program that simulate n rolls of six-sided die

Write a program that simulate n rolls of six-sided die and displays the frequency of occurrence of each side and What is the most likely method signature of the "parseInt() - TNE60003

  A remote web-based file storage application

Develop a web-based application. The server-side part of the application must be developed using Java Servlets (possibly including JSP). The development of the client (browser) side will typically be a combination of HTML and Javascript.

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