subject

With some questions. you!

question 1:

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 & & userguess > secretnumber)
while( userguess < secretnumber || userguess > secretnumber)
while( ! (userguess == secretnumber) )
a: i only
b: ii only
c: iii only
d: i and iii only
e: ii and iii only

question 2:
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 inclusive and the upper limit exclusive, which expression would properly generate values for the secret number?

a: (int)(math. random() * (upper − lower) ) + lower
b: (int)(math. random() * (upper − lower + 1) ) + lower
c: (int)(math. random() * (upper − lower) ) + lower + 1
d: (int)(math. random() * (upper − 1 − lower) ) + lower + 1
e: (int)(math. random() * (upper − lower + 1) ) + lower − 1

question 3:
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
}

a: the value of answer is n
b: the value of answer is n or n
c: the value of answer is not n
d: the value of answer is y
e: nothing can be determined

question 4:
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?

a: while( (userguess == secretnumber) || numguesses < 14 )
b: while( (userguess== secretnumber) & & numguesses < = 15 )
c: while( ! (userguess == secretnumber) || numguesses < 15 )
d: while( ! (userguess == secretnumber) & & numguesses < 15 )
e: while( ! (userguess == secretnumber) & & numguesses < = 15 )

question 5:
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 = 1;
while(x < 18)
{
x += 5;
}
system. out. println(x);

a: 16
b: 20
c: 21
d: 22
e: 26

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 04:31, mona92
Which of the following is not a way in which trees benefit the environment? a. they remove a significant amount of carbon dioxide from the atmosphere. b. they remove a significant amount of oxygen from the atmosphere. c. their roots hold soil in place, reducing rates of erosion. d. they remove ozone and particulates from the atmosphere. select the best answer from the choices provided a b c d
Answers: 1
image
Computers and Technology, 24.06.2019 01:30, jadaroyval
Write a program that asks the user to enter the name of an input file. if the file does not exist, the program should prompt the user to enter the file name again. if the user types quit in any uppercase/lowercase combinations, then the program should exit without any further output.
Answers: 3
image
Computers and Technology, 24.06.2019 13:30, sweeps8758
Which type of excel chart should be used to track students’ progress on test grades? line column bar pie
Answers: 2
image
Computers and Technology, 24.06.2019 15:20, 710jonathan
Local area networks use many of the same network technologies and the internet, only on a smaller scale. devices that access lans are equipped with a network interface that contains circuitry for wireless or wired connections. devices also have a physical address, in addition to the ip addresses acquired from a dhcp server. the most popular wired technology is . the most popular wireless technology is , which can be configured as a(n) or star topology. setting up a lan and configuring its router is fairly easy. the first step is to change the standard to one that is secure. next, create a(n) that uniquely identifies the network by name. it is also important to activate wireless to prevent wireless signals from being intercepted during transmission. a limited-access network can be created for visitors to use. by activating , the router will be able to assign ip addresses to each device that joins the network. to connect to a secure lan that is protected by encryption, an encryption , or password, is required. lans can be used to access data collected by iot devices and the networks that tie these devices together. technologies such as rfid, nfc, bluetooth smart, zigbee, and z-wave offer -power links, essential for battery-powered devices that can’t expend excess amounts of energy transmitting data.
Answers: 1
You know the right answer?
With some questions. you!

question 1:

errors can be syntax errors or logi...

Questions in other subjects:

Konu
Physics, 11.07.2019 22:50