subject

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

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
Apex q: what does a low employment rate indicate? a. not many people are earning high salaries b. not many people are going to college c. not many people are renting their homes d. not many people have jobs
Answers: 2
question
Computers and Technology, 22.06.2019 10:10
3. bob is arguing that if you use output feedback (ofb) mode twice in a row to encrypt a long message, m, using the same key each time, it will be more secure. explain why bob is wrong, no matter what encryption algorithm he is using for block encryption (15 points).
Answers: 3
question
Computers and Technology, 22.06.2019 20:00
What statement best describes operating systems? it’s possible for modern computers to function without operating systems. most operating systems are free or very inexpensive. operating systems are managed by the computer’s microprocessor (cpu). operating systems manage the computer’s random access memory (ram).
Answers: 1
question
Computers and Technology, 23.06.2019 03:30
In vista and windows 7, the appearance and personalization option allows you to change the
Answers: 1
You know the right answer?
Write a method named betonce that takes a console scanner and an integer as parameters and that allo...
Questions
question
Mathematics, 08.02.2022 08:10
question
Mathematics, 08.02.2022 08:10
question
English, 08.02.2022 08:10