In the code segment below, the int variable temp represents a temperature in degrees Fahrenheit. The code segment is intended to print a string based on the value of temp. The following table shows the string that should be printed for different temperature ranges.
31 and below --> "cold"
32-50 --> "cool"
51-70 --> "moderate"​
71 and above --> "warm"
String weather;
if (temp <= 31)
{weather = "cold";}
else
{weather = "cool";}
if (temp >= 51)
{weather = "moderate";}
else
{weather = "warm";}
System.out.print(weather);
Which of the following test cases can be used to show that the code does NOT work as intended?
1. temp = 30
11. temp = 51
111. temp = 60
A
I only
B
II only
C
I and II only
D
II and III only
E
I, II, and III

Respuesta :

Answer:

A

Explanation:

The code segment is intended to print a string based on the value of temp.

Option(D) can be used to show that the code does NOT work as intended

What is a string?

A string is typically a series of characters in computer programming, either as a literal constant or as some sort of variable. The latter can either have a set length or allow its elements to be altered.

A String Array is an Array with a predetermined number of String items. Similar to other Array data types, the String Array functions similarly. An example of a string of characters is "Hello World."

To learn more about a string, use the link given
https://brainly.com/question/24275769
#SPJ4