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

  Front end applications

How does a compiled binary executable store on the client computer?

  Write a program that reads a number in feet

Write a program that reads a number in feet, converts it to meters, and displays the result. One foot is 0.305 meters.

  Write a program that demonstrates hoe the classescollaborate

Write a program that demonstrates hoe the classescollaborate. To issue a parking ticket (generate a ParkingTicket object) if the car's time has expired.

  Display total amount owed in fixed-point notation

Enter your C++ instructions into a source file named Introductory11.cpp. Also enter appropriate comments and any additional instructions required by the compiler. Display the total amount owed in fixed-point notation with two decimal places.

  Advantages of contemporary languages allow kinds of comments

Many contemporary languages allow two kinds of comments, one in which delimiters are used on both ends (for multiple line comments), and one in which a delimiter marks only the beginning of the comment.

  Write a class that simulates managing a simple bank account

Write a class that simulates managing a simple bank account. The account is created with an initial balance. It is possible to deposit and withdraw funds, to add interest, and to find out the current balance.

  Analyse the program and execute it

I am working on a program that I want to use for a simple home energy data information system.

  Which warning signs or red flags are of greater importance

Discuss which warning signs or red flags are of greater importance to 123's given their size and location. Provide rationale behind your ranking.

  Generating data with a free pascal program

HW3 is about generating empirical data using Free Pascal (either using the Free Pascal IDE or the Lazurus system) and the function given by the language.

  Write a function that uses stream-map

Now write a function that uses stream-map to produce the sum of two streams element by element for the first x elements . Be sure to test with several different types of streams (for example, you could sum together the odd and even numbers betwee..

  Create application to use scrollable control track

Create the Application which permits you to enter amount of a purchase and then display the amount of sales tax on the purchase. Use a scrollable control such as a track bar to adjust the tax rate.

  Lunix

Compare the total number of links in a 20 node network for:

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