Display a welcome message on the screen

Assignment Help Business Management
Reference no: EM131934314

The aim of Gue55ing Game is for a person and the computer to compete against other to correctly guess a hidden number. 

A game consists of four rounds. For each round a number between 1 and 100 (inclusive) is randomly generated and the players (person and computer) take turns to guess the number. The round ends when the correct guess is given or each player has had three guesses.

If a player guesses the number correctly then they are awarded points according to how many attempts were taken to guess the number. If the round ends without either player guessing correctly then the points are awarded to each player according to how close they were to the hidden number.

At the end of the four rounds the player with the highest cumulative score wins the game.

Your program should consist of at least three classes: Player, Game and RandomNumber.

Player class

The Player class will specify the attributes and behaviours of a player. An object of the Player class will have the following fields (at least):

Name - the name of the player.

Score - the cumulative game score

Guesses - the last number guessed for the current round

The data type of each field must be chosen carefully and you must be able to justify the choice of the data type of the fields. You may want to include comments in the class to state the assumption made. The class must also have a default constructor and a non-default constructor that accepts a value for the name of the player.

The Player class should also have appropriate accessor and mutator methods for its fields. You should not allow an object of class Player to be set to an invalid state. There should be no input from the terminal or output to the screen. A Player object should also be able to return its state in the form of a String.

Game class 

The Game class will be in the same BlueJ project that contains your Player class. The Game class will manage the playing of a game. It will have the following fields (at least): 

Player1 (an object of type Player) 

Player2 (an object of type Player) 

Note that one of these players will be the computer. 

The Game class will have methods to manage the playing of the game. These should include (at least) the following behaviours: 

    • Display a welcome message on the screen.
  • • Request the player to enter their name. 
  • • Request the player to enter a number. 
  • • Compare the number entered by a player with the hidden number. 
  • • Display the result of the attempt at guessing the number. 
  • • Display the result for the end of a round (including the value of the hidden number). 
  • • Display the game result. 

RandomNumber class 

An object of the RandomNumber class will generate a random number from 1 to a maximum value specified.

Reference no: EM131934314

Questions Cloud

Addresses the hidden node problem : (a) Addresses the hidden node problem, but not the exposed node problem. (b) Addresses the exposed node problem, but not the hidden node problem.
Research and describe a product development process : Research and describe a product development or management process, methodology, or model that could be utilized to implement the innovation.
What makes the charismatic leaders strong role models : What are the work behaviors that the charismatic leaders display that lead to a positive outcome among followers? What makes the charismatic leaders strong role
Cyberspace overlap with concerns pertaining to cybercrime : Explain how issues involving security in cyberspace overlap with concerns pertaining to cybercrime.
Display a welcome message on the screen : The Game class will have methods to manage the playing of the game. These should include (at least) the following behaviours:
Propose an action plan for creating change : How change management, in the context of Lewin's or Kotter's model (select only one), can help the organization become a socially-responsible organization.
Prepare the taxes for a husband and wife : Prepare the taxes for a husband and wife; the husband and wife divorce and the husband is trying to hide income from the wife, what do you do
Write summary on the given topics : Write 200 words summary on the given topics: Chapter 2: The Political Economy of Transitional Labor in New York City: The Context for Immigrant Worker Militancy
What other benefits do you think toyota obtains : What other benefits do you think Toyota obtains from its production system? Think in broader terms than just production, consider financial and marketing .

Reviews

Write a Review

Business Management Questions & Answers

  Caselet on michael porter’s value chain management

The assignment in management is a two part assignment dealing 1.Theory of function of management. 2. Operations and Controlling.

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. Due to increase in the preference for light beer drinkers, Chris Prangel wants to introduce light beer version in Mountain Man. An analysis into the la..

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. An analysis into the launch of Mountain Man Light over the present Mountain Man Lager.

  Analysis of the case using the doing ethics technique

Analysis of the case using the Doing Ethics Technique (DET). Analysis of the ethical issue(s) from the perspective of an ICT professional, using the ACS Code of  Conduct and properly relating clauses from the ACS Code of Conduct to the ethical issue.

  Affiliations and partnerships

Affiliations and partnerships are frequently used to reach a larger local audience? Which options stand to avail for the Hotel manager and what problems do these pose.

  Innovation-friendly regulations

What influence (if any) can organizations exercise to encourage ‘innovation-friendly' regulations?

  Effect of regional and corporate cultural issues

Present your findings as a group powerpoint with an audio file. In addition individually write up your own conclusions as to the effects of regional cultural issues on the corporate organisational culture of this multinational company as it conducts ..

  Structure of business plan

This assignment shows a structure of business plan. The task is to write a business plane about a Diet Shop.

  Identify the purposes of different types of organisations

Identify the purposes of different types of organisations.

  Entrepreneur case study for analysis

Entrepreneur Case Study for Analysis. Analyze Robin Wolaner's suitability to be an entrepreneur

  Forecasting and business analysis

This problem requires you to apply your cross-sectional analysis skills to a real cross-sectional data set with the goal of answering a specific research question.

  Educational instructional leadership

Prepare a major handout on the key principles of instructional leadership

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