Skip to content

I am in need of assistance as my Programming isn’t very good

Do you have a similar question? Our professional writers have done a similar paper in past. Give Us your instructions and wait for a professional assignment!        

I am in need of assistance as my Programming isn’t very good: This… I am in need of assistance as my Programming isn’t very good: This assignment will give you practice with while loops and pseudorandom numbers. You are going to write a program that allows the user to play a simple game in which your program thinks up an integer and allows the user to try to determine the number with a minimum number of tries. For each incorrect try you will tell the user whether the right answer is higher or lower. Your program is required to exactly reproduce the format and behavior of the log of execution at the end of this write-up, so you may want to look that over first.?t a minimum, your program should have the following static methods in addition to method main:1.???A method to give instructions to the user2.???A method to play one game with the first user (just one game, not multiple games.)3.???A method to report overall results to the user.You may define more methods than this if you find it helpful, although you will find that the limitation that methods can return only one value will tend to limit how much you can decompose this problem.You are to define a class constant for the maximum number used in the game. The sample below selects a number from 1 to 100, but the choice of 100 is arbitrary. By introducing a constant for 100, you should be able to change just the value of the constant to make the program play the game with a range of 1 to 50 or a range of 1 to 250 or some other range starting with 1. ?hen 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.Assume that the user always types an integer when trying, that the integer is always in an appropriate range and that the user gives you a one-word answer beginning with “y”, “Y”, “n” or “N” when asked whether to play again.?ou will notice at the end of the log that you are to report various statistics about the series of games played by the user. You are to report the total number of games played, the total number of tries made (all games included), the average number of tries per game and the maximum number of tries used in any single game. You should also report the user’s best game(s) indicating which game(s) had the minimum number of tries and what that minimum was. Here are a few helpful hints to keep in mind:1.???This program needs to generate pseudorandom numbersTo deal with the yes/no response from the user, you might want to use some of the String class methods. You will want to use the next() method of the Scanner class to read a word from the console.Because this program uses pseudorandom numbers, you wont be able to recreate this exact log. The key requirement is that you reproduce the format of this log and that your calculations for overall statistics are correct for your log.It’s a good idea to change the value of your class constant and run the program to make sure that everything works right with the new value of the constant. For example, turn it into a game for numbers between 1 and 5. This program is more difficult than most to decompose into methods, so you may end up having methods that are longer than 15 lines. You are required to have a while loop in main that plays multiple games and prompts the user for whether or not to play another game. You shouldn’t have all the code in main because you are required to have the methods described at the beginning of this write-up.You are expected to make appropriate choices about when to store values as int versus double, which if/else constructs to use, what parameters to pass, and so onYour program should be stored in a file called Guess.java.Include a comment at the beginning of your program with basic information and a description of the program. This includes having an adequate comment header, commenting every line, and the integrity statement.Turn in your screenshot in Word of the output with filename JonBrownCIS1501ScreenShotsProgrammingAssignment3Jan122017 (your name, the coursename CIS1502, the content of the file, and the date), Guess.java and Guess.class (Please make sure to name your files exactly, including identical capitalization.) Then put all three files in one zip file. The zip file should be named: your name, the course name, the content of the file, and the dateand then submit to the Assignments link on the course web page.Log of execution (user input underlined)This program allows you to play a game.I will think of a number between 1 and 100and will allow you to try to determine it.For each try, I will tell you whether theright answer is higher or lower than yourtry.I’m thinking of a number…Your try? 20higherYour try? 40higherYour try? 60higherYour try? 80higherYour try? 100lowerYour try? 90lowerYour try? 88lowerYour try? 86Game #1: You got it right in 8 triesDo you want to play again? YesI’m thinking of a number…Your try? 20higherYour try? 40higherYour try? 60higherYour try? 80higher Your try? 82higherYour try? 84higherYour try? 86higherYour try? 88higherYour try? 90higherYour try? 92higherYour try? 94lowerYour try? 93Game #2: You got it right in 12 triesDo you want to play again? YESI’m thinking of a number…Your try? 20higherYour try? 40higherYour try? 60lowerYour try? 58lowerYour try? 56Game #3: You got it right in 5 triesDo you want to play again? NoOverall results:total games = 3total tries = 25tries/game = 8.333333333333334max tries = 12 Your best game was Game#3 in 5 triesComputer ScienceEngineering & TechnologyJava ProgrammingCIS 1502

Get a plagiarism-free order today   we guarantee confidentiality and a professional paper and we will meet the deadline.    

Leave a Reply

Order a plagiarism free paper today. Get 20% off your first order!

X