Computers and Technology, 28.10.2019 03:31 nessuhbae6731
Question 1
errors can be syntax errors or logic errors (the code works, but not as intended).
in the guess my number game, there is a lower limit and an upper limit for the range of possible numbers to guess. if the lower limit were exclusive and the upper limit exclusive, which expression would properly generate values for the secret number?
(int)(math. random() * (upper − lower) ) + lower
(int)(math. random() * (upper − lower + 1) ) + lower
(int)(math. random() * (upper − lower) ) + lower + 1
(int)(math. random() * (upper − 1 − lower) ) + lower + 1
(int)(math. random() * (upper − lower + 1) ) + lower − 1
question 2
errors can be syntax errors or logic errors (the code works, but not as intended).
which of the following is equivalent to while( ! (userguess == secretnumber) )?
while( userguess ! = secretnumber )
while(userguess < secretnumber || userguess > secretnumber)
while( userguess < secretnumber & & userguess > secretnumber)
i only
ii only
iii only
i and ii only
i and iii only
question 3
errors can be syntax errors or logic errors (the code works, but not as intended).
after execution of the following code segment, what will be displayed?
int x = 15;
while(x > 0)
{
x −= 6;
}
system. out. println(x);
−6
−3
0
3
15
question 4
errors can be syntax errors or logic errors (the code works, but not as intended).
what conclusion can be made about the state of the program when the while loop terminates? assume answer is a declared and initialized string.
while(! answer. equals( "n"))
{
// code not shown
}
the value of answer is n
the value of answer is n or n
the value of answer is not n
the value of answer is y
nothing can be determined
question 5
errors can be syntax errors or logic errors (the code works, but not as intended).
in the guess my number program, the user continues guessing numbers until the secret number is matched. assuming numguesses is initialized to 1, how would the while statement be modified to include an extra criterion limiting the number of guesses to 15?
while( (userguess == secretnumber) || numguesses < 14 )
while( (userguess== secretnumber) & & numguesses < = 15 )
while( ! (userguess == secretnumber) || numguesses < 15 )
while( ! (userguess == secretnumber) & & numguesses < = 15 )
while( ! (userguess == secretnumber) & & numguesses < 15 )
Answers: 3
Computers and Technology, 22.06.2019 06:40, EricaLSH7624
Match the personality traits with their description
Answers: 2
Computers and Technology, 23.06.2019 13:30, carolelai08
Stops: using the information learned in this course, explain three things you will not do when driving. a. b. c. explain why you will not do these things when driving. starts: using the information learned in this course, explain three things you will do when driving. a. b. c. explain why you will do these particular things when driving. explain one thing you will stop doing as a passenger. explain one thing you will start doing as a passenger.
Answers: 3
Question 1
errors can be syntax errors or logic errors (the code works, but not as intended).<...
errors can be syntax errors or logic errors (the code works, but not as intended).<...
English, 01.12.2020 04:30
History, 01.12.2020 04:30
Mathematics, 01.12.2020 04:30
English, 01.12.2020 04:30