Cheap Essay logo
  • Home
  • Custom Papers
  • Dissertation Help
  • Essay Writing
  • My account
  • Order now
Order Now
Homework Help

Java level 1 programming assignments

2 min read
Posted on 
April 28th, 2022
Home Homework Help Java level 1 programming assignments

Asignments/Object Oriented Programming Problem Set.docx Problem 4: Define a class called Counter. An object of this class is used to count things so it records a count that is a non-negative whole number. Include methods to set the counter to 0, to increase the counter by 1, and to decrease the counter by 1. Be sure that no method allows the value of the counter to become negative. Also include an accessor method that returns the current count value, as well as a method that displays the count on the screen. 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. (Hint: you need only one instance variable). Problem 5: 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. Problem 6:…

Order an Essay Now & Get These Features For Free:

Turnitin Report

Formatting

Title Page

Citation

Outline

Place an Order
Share
Tweet
Share
Tweet
Calculate the price
Pages (275 words)
$0.00
Cheap Essay
Company
  • About Us
  • Coursework Writing
  • Custom Papers
  • Dissertation Help
  • Dissertation Writing
  • Essay Writing
Legal
  • Term Papers
  • Terms
  • Thesis Format
  • Thesis Statement
  • Why Choose Us
  • Write My Essay
How Our Service is Used:
Cheap Essay essays are NOT intended to be forwarded as finalized work as it is only strictly meant to be used for research and study purposes. Cheap Essay does not endorse or condone any type of plagiarism.
Subscribe
No Spam
© 2023 Cheap Essay. All rights reserved.
Cheap Essay will be listed as ‘Cheap Essay’ on your bank statement.