Modify the numbers guessing game program

Assignment Help JAVA Programming
Reference no: EM13700803

Question: Modify the numbers guessing game program. Suppose that the variable num and guess are as declared and the diff is an int variable. Let diff= the absolute value of (num-guess). If diff is 0, then guess is correct and the program outputs a message indicating that the user guessed the correct number.

Suppose diff is not 0. Then the program outputs the message as given:

Part 1: If diff is greater than or equal to 50, the program outputs the message indicating that the guess is very high(if guess is greater than num) or very low ( if guess is less than num).

Part 2: If diff is greater than or equal to 30 and less than 50, the program outputs the message indicating that the guess is high (if guess is greater than num). or low ( if guess is less than num).

Part 3: If diff is greater than 0 and less than 15, the program outputs the message indicating that the quess is somewhat high (if guess is greater than num) or somewhat low (if guess is less than num).

You need to modify the numbers guessing game program

Reference no: EM13700803

Questions Cloud

Calculate the concentration of the zn2 (aq) ion : Question- The voltage generated by the zinc concentration cell described by, Zn(s)|Zn2 (aq, 0.100 M)||Zn2 (aq, ? M)|Zn(s) is 14.0 mV at 25 °C. Calculate the concentration of the Zn2 (aq) ion at the cathode.
Explain the neutral form of the amino acid histidine : Question- Consider the neutral form of the amino acid histidine, given a pH of 3.00, how many mL of 0.050M HClO4 should be added to 25mL of 0.040M Histidine
Simulate an atm machine and provide the code : Simulate an ATM machine and provide the code. I have the answer already but i do not understand it; I need expert to guide through it step by step. thanks!
What volume of solution would be required to neutralize : Question- An acid solution is 0.1200M in HCI and 0.2500M in H2SO4. What volume of 0.14M NaOH solution would be required to neutralize 200ml of the acid solution
Modify the numbers guessing game program : Modify the numbers guessing game program. Suppose that the variable num and guess are as declared and the diff is an int variable.
Explain how many molecules of mgoh2 have you produced : Question- 1) How many grams of Na3(PO4) contain 2.5 x 10^23 Na atoms report the answer to the correct number of sig. figures 2) Given the following reaction
Create a java gui application using netbeans : Create a Java GUI application using Netbeans that allows the user to enter the number of hours spent in each activity and then calculates the number of pounds lost.
Explain what is the pressure of the heated gas : Question- A sample of gas at a pressure of 1.79 atm and a temperature of 21.2oC is heated to 48.5oC. If the gas expanded to 2.59L from 2.12L, what is the pressure of the heated gas
Solve problem by using a system of linear equations : Solve this problem by using a system of linear equations. Clearly show how many variables you are using and how you are forming the matrices.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Writing a program to have it generate random words

How would I go about writing a program to have it generate random words with a letter missing for a child to guess? Maybe it would have three letters, then four, next five, and so on until maybe 10 letters. Please keep in mind that I'd like it to wor..

  Part - 1build a graphical user interface for displaying the

part - 1build a graphical user interface for displaying the image groups cluster in jmjrst. design and implement using

  Write a program that will prompt the user for a file name

Write a program that will prompt the user for a file name and open that file for reading. Print out all the information in the file, numbering each new line of text.

  Determine the java application on web

Determine the Java application on Web and explain how program structure functions. Explain the application in as much detail as possible.

  Part iyou have to write a computer program that will figure

part iyou have to write a computer program that will figure out the total of an order when given the amount of the

  Create java application which creates random phone number

Create and implement Java application which creates and prints a random phone number of the form xxx-xxx-xxxx. Include the dashes in the output.

  Write a class and a client class

Write a CLASS and a CLIENT CLASS that stores hotels ratings over the years. The number of stars represents hotel ratings. Each element of the 2-dimensional array stores an integer value between 1 - 5, which represents the number of "stars" this ho..

  Write a method in java that uses a switch statement

Write a method in JAVA that uses a switch statement and takes a person's age using an integer parameter , then checks if the age is valid (0-110), and then RETURNS a string based on the age

  Ask the user to input a grade (integer from 1-100)

Program should still ask the user to input a grade (integer from 1-100) and then output the letter grade.  Scale:  Greater than 90 is an "A"; Greater than 80 to 90 is a "B", Greater than 70 to 80 is a "C", Greater than 60 to 70 is a "D", and 60 or le..

  Which a ball is released from a user-defined height

Write a program in which a ball is released from a user-defined height and free-falls to the ground. The ball is pulled by earth's gravity of 9.8 m/sec 2 . Assume that each pixel represents

  Create an array of date objects

Create an array of Date objects of size 4. Initialize the array by using a loop. In the loop, use the Scanner.nextLine() method to input a date as a string, convert it to a date by using the toDate() method, and assign the result to an element in ..

  Traditionally-nutrition programs were targeted to indigent

Traditionally, nutrition programs were targeted to the indigent and poor populations in developing countries. Many of today's Americans are malnourished also, but they are glutted with a wealth of unhealthy foods and require a multidisciplinary appro..

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