Define a class constant for the maximum number

Assignment Help Computer Engineering
Reference no: EM131845911

Assignment: Programming for Networking

Purpose

This assignment assesses the basic concepts of programming; students should be able to demonstrate their achievements in the following unit learning outcomes:

a. describe the fundamental principles of object-oriented programming;

b. interpret a user's needs while dealing with simple program specifications;

c. design a simple class using UML notation;

d. create a simple application based on UML design and the incremental development process of coding, debugging, and
testing;

e. apply basic control structures - sequence, repetition, and selection - to program development;

f. produce simple interactive applications.

Prepared by: David Chisanga Moderated by: Dr Javed Ali Baloch November, 2017

This assignment will give you practice with interactive programs, if/else statements, methods that return values, String methods and while loops.

Benjamin is looking at developing a simple guessing game. The idea behind that the game is that the program generates a random number and allows the user to make guesses until the user gets it right. For each incorrect guess, the program tells the user whether the right answer is higher or lower as shown in the example log of execution below.

Task requirements

1. Design a UML class diagram that meets the program specification given above

2. Translate your design above to Java. The program should be stored in a file called MITnnnnnGuess.java where MITnnnnn is your MIT student ID.

3. Define a class constant for the maximum number (MAXGUESS) that the user can guess.

4. Correctly implement the following static methods in addition to method main:

• A method that generates a random number between 1 and maximum number defined in 2 (this method has been generated for you)
• a method to give instructions to the user
• a method to play one game with the user

5. When you ask the user whether or not to play again, you should use the "next()" method of the Scanner class to read a one-word answer from the user. You should continue playing if this answer begins with the letter "y" or the letter "Y". Notice that the user is allowed to type words like "yes". You are to look just at the first letter of the user's response and see whether it begins with a "y" or "n" (either capitalized or not) to determine whether to play again.

6. At the end of the log you are to report various statistics about the series of games played by the user, these being the total number of games played (use a variable to keep track of this), the total number of guesses made (use another variable to keep track of this), and the average number of guesses per game.

Reference no: EM131845911

Questions Cloud

Identify and discuss the six key current challenges : Discuss how the three perspectives of sustainability influence (or perhaps, should influence) your personal purchasing decisions.
Describe the recruitment process and the selection process : Describe the recruitment process and the selection process your organization uses.
How do you recognize review participant who has not prepared : How do you recognize a review participant who has not prepared? What do you do if you're the review leader?
Hr in global context : What are the pros and cons of accepting an overseas assignment for a multinational organization?
Define a class constant for the maximum number : Design a UML class diagram that meets the program specification given. Define a class constant for the maximum number (MAXGUESS) that the user can guess.
Why do you believe it is an important step : Why do you believe it is an important step within a strategic planning process to conduct a SWOT analysis? How can a VRIO help an organization?
President position and the implementation of elections : Iran has come along way in the past 15 years or so with the employment of the lose democratic policies and procedures
Large number of sub-contractors : Mattel had 37 contract manufacturers in China in 2006. Those contract manufacturers in turn used a large number of sub-contractors
Implementing a training program : Assess the pros/cons of designing and implementing a training program without conducting a needs analysis?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Name and briefly describe each of these categories

Streaming video can systems can be classified into three categories. Name and briefly describe each of these categories?

  As you learn more about disk storage options for the web

assume you are planning web server computer capacity for a business that has 5000 business customers and sells about

  Describe a rigorous formulation of the problem

Describe the problem in your own area of expertise highlighting where it is possible to apply one of the computational models - Describe the motivations

  How to calculate the input value required to yield

Which program evaluates the most important solutions for problems with multiple input values.

  Create a class named musicalinstrument

Design and implement a musical instrument class along with 4 subclasses using the following guidelines: Create a class named MusicalInstrument and its four subclasses named Woodwind, Brass, String and Percussion.

  To compute the sum of the values in an array

To compute the sum of the values in an array, add the first value to the sum of the remaining values, computing recursively.

  How much of companys network capacity are employee consuming

How much of the company's network capacity are employees consuming when watching YouTube videos?

  Assuming that your group is in the testing phase of the

imagine that you are the head of the design team for a new video game concept.assuming that your group is in the

  Discuss the basic features of risc and cisc

What is the basic difference between program execution by a conventional CPU and the PIC18F CPU?

  Determine the temperature drop of water

Hot water is flowing at an average velocity of 4 ft/s through a cast iron pipe (k = 30 Btu/h.ft.°F) whose inner and outer diameters are 1.0 in and 1.2 in.

  How long it took you to solve each of the puzzles

What assumptions you made; what deductions you made, etc. What are the English cleartexts from which these two ciphertexts were derived? How long it took you to solve each of the puzzles.

  What does a relational database use to relate tables

cis407a- What does a relational database use to relate tables in the database to each other? Which of the following SQL statements can be generated automatically by the Configure Data Source wizard?

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