Consider a class that could be used to play a game of

Assignment Help JAVA Programming
Reference no: EM13380065

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: EM13380065

Questions Cloud

Part 11 how many cells can be in a computers main memory if : part 11. how many cells can be in a computers main memory if each cells address can be represented by two hexadecimal
Question 1write a recursive method nmbdigits which takes an : question 1write a recursive method nmbdigits which takes an integer value as parameter and returns the number of digits
Project specificationerp project implementation atoledo : project specificationerp project implementation atoledo pizza company is planning to implement a new erp system. tim
1online bankingwhat special consequences do you foresee : 1.online bankingwhat special consequences do you foresee from information security breaches confined to online retail
Consider a class that could be used to play a game of : consider a class that could be used to play a game of hangman. the class has the following attributesthe secret wordthe
Define a class called counter an object of this class is : define a class called counter. an object of this class is used to count things so it records a count that is a
Problem 1 write a program that prints a multiplication : problem 1 write a program that prints a multiplication table like this 1 2 3 4 5 6 7 8 9 10 2 4 6 8 10 12 14 16 18 20 3
Problem1 the fibonacci numbers are defined by the : problem1 the fibonacci numbers are defined by the sequencef1 1 f2 1 fn fn-1 fn-2.reformulate that asfold1 1 fold21
This assignment will focus on creating java servlets that : this assignment will focus on creating java servlets that can not only serve html to web users but also provide a web

Reviews

Write a Review

JAVA Programming Questions & Answers

  The reference to the abstract class

Explain what happens when the reference to the abstract class X is used to execute method M1( ). X obj = new Y( ); obj.M1( );

  Elements from a html document

Function test Count List Elements should simply retrieve an array of all list elements on the page and assert that their total count is 3.

  The williamsburg women''s club

The Williamsburg Women's Club offers scholarships to local high school students who meet any of several criteria. Write an application that prompts the user for a student's numeric high school grade point average (for example, 3.2), the student's num..

  Develop parent lock method asks for four digit password

Develop the parent lock method (turns lock on/off) which asks for 4 digit password. Navigating to any channel which is in range 99-110 must ask for password when parent lock is on.

  Organization structure change over time

How and why did the organization structure change over time, and in what ways were some of these changes responsible for some of their recent problems?

  Using the following data definition classpublic class

using the following data definition classpublic class circle private int radiuspublic circleint r radius rpublic int

  Quadratic that solves quadratic equations

Write a method called quadratic that solves quadratic equations and prints their roots. Recall that a quadratic equation is a polynomial equation in terms of a variable x of the form ax2 + bx + c = 0. The formula for solving a quadratic equation is ?..

  Java program to print strings given at command line

Write down program Average.java to print strings which it is given at command line, one per line. If nothing is given at command line, then print "No arguments".

  A method with the signature public static void

A method with the signature public static void printDetails(City[] cities) that will iterate through the cities and printthe details of the city using the displayDetails(...) method.

  The department of community affair- jail report

The Department of Community Affairs (DCA) for the State of Georgia performs many functions including gathering statistics and doing research. DCA provides a monthly jail report that provides some interesting information about jails in the state.

  Despite public and private health insurance programs

Why is it that despite public and private health insurance programs, some US citizens are without health coverage?

  Write following java expressions in mathematical notation

Write the following Java expressions in mathematical notation.

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