subject

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 )

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:00
How can i clip a picture to a question on the computer?
Answers: 1
question
Computers and Technology, 22.06.2019 10:30
What can tanya do now to start preparing for the college and scholarship application process? think about her grades, activities in which she can get involved, possible part-time jobs at which she can work, and standardized tests she can take. (10 points) apex
Answers: 2
question
Computers and Technology, 22.06.2019 13:30
Jane’s team is using the v-shaped model for their project. during the high-level design phase of the project, testers perform integration testing. what is the purpose of an integration test plan in the v-model of development? a. checks if the team has gathered all the requirements b. checks how the product interacts with external systems c. checks the flow of data in internal modules d. checks how the product works from the client side
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
What are listed in the vertical columns across the top of the event editor? a. file names b. conditions c. check marks d. action types
Answers: 1
You know the right answer?
Question 1
errors can be syntax errors or logic errors (the code works, but not as intended).<...
Questions
question
English, 26.07.2019 18:00
Questions on the website: 13722360