Computers and Technology

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 )

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:00, savannahckatz
Business professionals of america, and future business leaders of america – phi beta lambda are both open to business students at which levels? check all that apply. elementary school middle school high school college
Answers: 1
image
Computers and Technology, 22.06.2019 20:00, ksanchez2100
Need asap assignment directions: think of an organization (business, religious institution, volunteer organization, sports team) with which you have been involved. imagine outfitting it with an it infrastructure. prepare a plan for what you would do to support outfitting it. draw a map of a network connecting all the individuals, give them pcs and printers, and lay out the design as best you can. the purpose is to begin working with these concepts, not to build a perfect network.
Answers: 2
image
Computers and Technology, 23.06.2019 07:00, lin550
Why were most movies from the late 1890s until the early 1930s only filmed in black and white? there were only a few people who could afford the technology to produce color motion pictures back then. audiences did not want color motion pictures until later. the film used to make color motion pictures often overheated, which was a safety hazard, so it was generally not allowed. color films had to be hand-colored, frame by frame.
Answers: 3
image
Computers and Technology, 23.06.2019 11:30, magicalpenguin48
In cell h5 enter a formula that will calculate the percentage of attendees that went to the altamonte springs job fair in 2018.
Answers: 1
Do you know the correct answer?
Question 1
errors can be syntax errors or logic errors (the code works, but not as intended).<...

Questions in other subjects: