Computers and Technology

Write a method named betonce that takes a console scanner and an integer as parameters and that allows the user to make a bet about the integer. the bet involves guessing whether a number between 1 and 36 is in the lower half of the range (1 through 18) or the upper half of the range (19 through 36). it will also be possible for the number to be 0, in which case the user always loses. these rules are used in a game called roulette. your method will be passed a scanner that can be used to read input from the user and it will be passed the number that the user is betting on. for example, the main method might look like this:

scanner console = new scanner(system. in);
random r = new random();
int number = r. nextint(37);
betonce(console, number);

your method should prompt the user for which bet they want to make and should then report the
number and whether the user won or lost. for example, below is a log of execution where the user enters "1" to bet on the low range:
do you want to bet on 1) low or 2) high? 1
the number was 1
you win
below is a log where the user enters "2" to bet on the high range:
do you want to bet on 1) low or 2) high? 2
the number was 11

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 02:30, noah2o2o
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
image
Computers and Technology, 24.06.2019 00:20, talyku843
Describe a data structures that supports the stack push and pop operations and a third operation findmin, which returns the smallest element in the data structure, all in o(1) worst-case time.
Answers: 2
image
Computers and Technology, 24.06.2019 04:30, NEUROPHARMACOLOGICAL
The ieee 802.11: defines standards for wireless local area network (wlan) communication protocols. identifies various computers or devices connected to a network. verifies any resource attached to another computer on a network that is different from the computer to which the user is logged on. connects multiple local area networks (lans) and wide area networks (wans).
Answers: 2
image
Computers and Technology, 24.06.2019 14:30, tleppek6245
Alison is having a hard time at work because hee inbox is flooded with emails every day. some of these emails are unsolicited. some of other she don’t need. which action should she take to better manager her emails?
Answers: 1
Do you know the correct answer?
Write a method named betonce that takes a console scanner and an integer as parameters and that allo...

Questions in other subjects:

Konu
Mathematics, 29.08.2019 05:10