Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In java Create a number guessing game with a twist! Prompt the user to enter a % chance for the following ranges: 1-100, 101-200, 201

In java

Create a number guessing game with a twist!

Prompt the user to enter a % chance for the following ranges: 1-100, 101-200, 201 - 300, 301-400, 401-500, 501-600, 601-700, 701 -800, 801-900, 901-1000

Based on these percentages, have the program select a random number between 1-1000. (Example: If there is a 25% chance for 201-300, there should be a 25% weighted chance for the program to select a number between 201-300)

Prompt the user to then make ONE guess between 1-1000.

If the number is within 150 of the randomly selected target number, Print "Good guess!"

If the number is over 151 but under 300 away, Print "Keep trying!"

If the number is over 301 away, print "You should stop"

Then ask the user if they would like to play again or quit

BONUS: Make 1000 loop back around to 1 so that for example, number 5 would only be 15 away from 990.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis In Microsoft Excel

Authors: Alex Holloway

1st Edition

B0CCCPKTTX, 979-8852388452

Students also viewed these Databases questions

Question

Personnel Psychology

Answered: 1 week ago