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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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