Build an application that will receive a guess

Assignment Help JAVA Programming
Reference no: EM133389688

Build an application that will receive a guess and report if your guess is the random number that was generated.  Your application will narrow down the choices according to your previous guesses and continue to prompt you to enter a guess until you guess correctly. 

Notice the user can guess at most 7 times.

You will use the utility class RNG.java. 

Data Element Class - RNG

  • Provided - Do Not change this file or your assignment will fail instructor's test cases.
  • This file will generate a random number between 1 and 100
  • This class has the following methods:
    • rand
    • resetCount
    • getCount
    • inputValidation
    • incrementCount
    • getMaxGuessCount
  • Refer to the description of each method provided in the RNG.java file.

Driver Class - RandomNumberGuesser

  • Make this class and name it RandomNumberGuesser.
  • This is the driver class for RNG.
  • Since this class is the driver it should contain a main method.
  • You do NOT need to import RNG class.
  • You do NOT need to create an instance of RNG class in this class.
    • Note that the all methods of this RNG class are static methods), that means the RNG class does not need to be instantiated to use it. (We will learn about static methods later in the course
  • You will need to use/call all methods of RNG class:
  • You can call these methods by RNG.[Method Name]; for example RNG. getCount(), RNG.rand()
  • The driver is responsible to:
    • Generate a random number between 1 and 100.
      • Call RNG.rand() to generate a random number between 1 and 100.
    • Ask the user for an initial guess of the generated random number.
    • Print out the result for that guess using the methods from the RNG class.
    • Allow user to give another guess between (exclusive) the previous low and high guesses
    • Display the number of guesses after each guess.
    • When user guesses correctly, ask if the user wants to try another round.
    • Terminate the program after the user has reached 7 guesses.
    • Refer to the program sample run for more clarification.
  • Data Validation. The data is validated by the RNG method inputValidation:
    • Guess must be an integer between (exclusive) the previous low guess and high guess.
    • If the data is invalid, the method does not increment the number of guesses.

Reference no: EM133389688

Questions Cloud

Discuss the lynching of sam hose : Discuss the lynching of Sam Hose. What is this case's significance for U.S. history? How did it influence activists who fought for change in the US?
Do you believe its an instrument controlled by government : Do you believe its an instrument controlled by the government to spy on U.S. Citizens? By purchasing such a device, do you believe the American People gave up
Draw a state machine using the specification : Draw a state machine using the specification above to process the list of integers. Use StarUML to draw your state machine (statechart)
Identify the major risks in the redbox startup : Identify the major risks in the Redbox startup that prevented venture capitalists from investing in the company.
Build an application that will receive a guess : Build an application that will receive a guess and report if your guess is the random number that was generated. Your application will narrow down the choices
What is the importance of mary burke in upton sinclair : What is the importance of Mary Burke in Upton Sinclair's King Coal? What are the culture shocks within the book between the 19th century and 20th century?
Expected in modern world of work : Is the practice of being required to work "off-the-clock" an unethical practice or just "to be expected" in modern world of work?
How does the book king coal reflect a clash : How does the book King Coal reflect a clash between late 19th century ideologies and values and the values of the early twentieth century?
How did the nation first and largest guestworker program : How did the nation's first and largest guestworker program establish the context for the U.S. treatment of Mexican labor migrants? How does the labor migration

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a recursive method that converts a decimal integer

Write a recursive method that converts a decimal integer to a binary swing. Write a recursive method that converts a binary string to a decimal integer.

  Discusses the architecture for the web socket api

Locate and share an article that discusses the architecture for the Web Socket API. Identify and share an application that uses the web socket technology

  Aspect of international risk management for a manager

What do you think is the most important aspect of international risk management for a manager? Why? Explain in details

  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 ?..

  International trade theory

All countries benefit from trade. If they did not, they would not trade. Based on this week's Reading Assignment, apply what you know about International Trade

  Write a program that displays a drawing popular hangman game

Write a program that displays a drawing for the popular hangman game, as shown in Figure 15.32(c). draws a sketch for the hangman game.

  Design your own java class that includes three data fields

Design your own Java Class that includes at least 3 data fields, 2 constructors and 4 methods. When designing your class, pick an object that you are familiar with and make it your own, realistic, yet simple design with reasonable data fields and ..

  Write program using a switch statement that display polygon

Write a program using a switch statement that displays the name of a polygon with sides between 3 and 12 depending on the number entered by the user

  Create and implement class called date to store month

Create and Implement the class called Date which has data members to store month (as a number), day, year, and name of month.

  Punished for minor infractions given their mental illness

What if you a Disciplinary Hearing Officer in a unit with mentally ill inmates? How would you sanction offenders for infractions without punishing them for their illnesses? Do you think they should be punished for minor infractions given their mental..

  Write a program to reverse a string using a stack

Write a program to reverse a string using a stack. Please show code in Java. The response must be typed, single spaced.

  1 introductionin order to debug an application it is

1 introductionin order to debug an application it is sometimes useful to know where a given object comes from or where

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