Answer:
e) Code segment II produces correct output for all values of str, but code segment I produces correct output only for values of str that contain "pea" but not "pear".
Explanation:
<em>if - elseif - else statements work in sequence in which they are written. </em>
- <em> </em>In case <em>if() statement is true, </em>else if() and else statements will not get executed.
- In case <em>else if() statement is true</em>, conditions in if() and else if() will be checked and else statement will not be executed.
- In case <em>if() and else if() both are false</em>, else statement will be executed<em>.</em>
First, let us consider code segment I.
In this, first of all "pea" is checked in if() statement which will look for "pea" only in the String str. So, even if "pearl" or "pear" or "pea" is present in 'str' the result will be true and "pea" will get printed always.
After that there are else if() and else statements which will not get executed because if() statement was already true. As a result else if() and else statements will be skipped.
Now, let us consider code segment II.
In this, "pearl" is checked in if() condition, so it will result in desired output.
Executable code is attached hereby.
Correct option is (e).
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark">
java
</span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark">
java
</span>
Answer:
C
Explanation:
Putting all government forms on the city web site is the least activity likely to be effective in the purpose of reducing digital divide.
Holding basic computer classes at the community centers will very much help to reduce the digital divide.
Providing free wireless internet connections at locations in low-income neighborhood will also reduce the gap of digital divide
Requiring that every city school has computers that meet a minimum hardware and software will made computing resources available to users thereby reducing digital divide.
Assessing the risk that surrounds stationary work of
employees spending hours at their stations is essential. Below is a list of
fundamental ergonomic principles that help identify ergonomic risk factors.
<span>1.
</span>Are the
employees maintained in a neutral posture?
<span>2.
</span>Does the
stationery allow for movement and stretching?
<span>3.
</span>Is there
adequate lighting?
<span>4.
</span>Are chairs
adequately adjustable?
<span>5.
</span>Are there
appropriate foot rest?
<span>6.
</span>Is there
extra storage for better desk organization?
Answer:
Setting of short lease time for IP addresses in order to enhance quicker access from clients
Modems create an analog signal that carries digital data on it,
and strip the digital data from an analog signal that they receive.
That's what's needed to connect through the telephone system,
since the telephone system is still one big analog system.