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 07:30
Events and conditions that happen within an organization that are somewhat easier to deal with when responding to change are called
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
I'll mark brainliest if answered right! with which feature or menu option of a word processing program can you make an image like this? you can get this image using the option of a word processing program.
Answers: 1
question
Computers and Technology, 23.06.2019 00:40
Consider the following statements: struct nametype{string first; string last; }; struct coursetype{string name; int callnum; int credits; char grade; }; struct studenttype{nametype name; double gpa; coursetype course; }; studenttype student; studenttype classlist[100]; coursetype course; nametype name; mark the following statements as valid or invalid. if a statement is invalid, explain why.a.) student.course.callnum = "csc230"; b.) cin > > student.name; c.) classlist[0] = name; d.) classlist[1].gpa = 3.45; e.) name = classlist[15].name; f.) student.name = name; g.) cout < < classlist[10] < < endl; h.) for (int j = 0; j < 100; j++)classlist[j].name = name; i.) classlist.course.credits = 3; j.) course = studenttype.course;
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Design a class tictactoe that: holds the following information about the game: two-dimensional array (3 by 3), and winner. add additional variables as needed. includes the functions to perform the various operations on objects. for example, function to print the board, getting the move, checking if move is valid, determining if there is a winner after each move. add additional operations as needed. includes constructor(s). write the functions of the class, and write a program that uses the class. the program should declare an object of type tictactoe. the program will create the board and store it in the array. the program will allow two players to play the tic-tac-toe game. after every valid move update the array, check if there is a winner. if there is no winner and no tie, then print the board again to continue.
Answers: 2
You know the right answer?
Write a method named betonce that takes a console scanner and an integer as parameters and that allo...
Questions
Questions on the website: 13722367