Define a class constant for the maximum number

Assignment Help Programming Languages
Reference no: EM131834222

Programming for Networking Assignment

Purpose - This assignment assesses the basic concepts of programming; students should be able to demonstrate their achievements in the following

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.

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.

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 (MAX_GUESS) 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.

Attachment:- Assignment Files.rar

Reference no: EM131834222

Questions Cloud

Identify the key variables you are going to be investigating : Choose whether or not you will be conducting non-participant observation in a social setting, or content analysis of a social artifact.
Was the emancipation proclamation a necessary wartime : Was the emancipation proclamation a necessary wartime edict or simply an attempt to address a major cause of the civil war. With details and examples.
Efforts to remove native americans : I will be discussing various situations that have to deal directly with European influence when it comes to illness and war efforts to remove Native Americans.
Define research issues in human resource management : The specific course learning outcomes associated with this assignment are: Analyze effective recruiting and selection strategies that can be used to meet.
Define a class constant for the maximum number : BN108/BN108D Programming for Networking Assignment. Define a class constant for the maximum number (MAX_GUESS) that the user can guess
How will rising temperatures : 1.How will rising temperatures (6 degrees C by end of 2100) affect Asia
What lessons can be learned from the jungle : In the eyes of an immigrant, what lessons can be learned from The Jungle? You must have a thesis paragraph and a concluding paragraph.
How is the global expansion of social media : How is the global expansion of social media likely to affect how people pursue social change? How has it done so already?
Explain the particular problems the us army : Explain the particular problems the U.S. Army experienced, and describe how successful the civilian and military operations were between 1899

Reviews

len1834222

1/27/2018 4:58:07 AM

Formatting & Referencing: APA. Here is the question. 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.

len1834222

1/27/2018 4:58:00 AM

Submission Guidelines - All work must be submitted on Moodle by the due date along with a completed Assignment Cover Page. The assignment must be in MS Word format, 1.5 spacing, 11-pt Calibri (Body) font and 2 cm margins on all four sides of your page with appropriate section headings. Reference - sources must be cited in the text of the report, and listed appropriately at the end in a reference list using IEEE referencing style.

len1834222

1/27/2018 4:57:54 AM

Task 1 - Comments describing program, author and date are included Import statement is included Class is named appropriately. Task 2 - Class constant is declared and initialized. Task 3 - Correctly calls method that generates random number Method to print instructions is correctly declared Method to play game is implemented and runs successfully Task 4 - Implements a loop to allow the game to continue running until the user quits Successfully uses the scanner and if-else statements to check if user wants to continue playing Task 5 - Method to report overall results is implemented and runs successfully Others Use whitespace properly to make program more readable, such as between operators and their operands, between parameters, and blank lines between groups of statements or methods.

len1834222

1/27/2018 4:57:49 AM

Give meaningful names to methods and variables in your code. Localize variables whenever possible -- that is, declare them in the smallest scope in which they are needed. Your program compiles successfully without any errors. Program is well documented, includes import statements to support external classes and the class name is named appropriately Constant is declared appropriately. Method design and implementation is clear and easy-to- follow. Loop is correctly and successfully used. Method to output results is well implemented and runs successfully. Follows syntax rules and Java programming conventions, program runs correctly.

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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