Question: Study the code below and determine which option represents the correct if - then - else statement for the given ternary operator: Console.Write (
Study the code below and determine which option represents the correct ifthenelse statement for the given ternary operator:
Console.WriteWhat is the temperature today? ;
string input Console.ReadLine;
double temp double.Parseinput;
string result temp It is hot today" : It is not so hot today";
Console.WriteLineresult;
a
Prompt the user to enter a temperature
Console.WriteWhat is the temperature today? ;
string input Console.ReadLine;
double temp double.Parseinput;
string result string.Empty;
if temp
result It is hot today";
else
result It is not so hot today";
Console.WriteLineresult;
b
Console.WriteWhat is the temperature today? ;
string input Console.ReadLine;
double temp double.Parseinput;
string result string.Empty;
if temp
result It is hot today";
if temp
result It is not so hot today";
Console.WriteLineresult;
c
Prompt the user to enter a temperature
Console.WriteWhat is the temperature today? ;
string input Console.ReadLine;
double temp double.Parseinput;
string result string.Empty;
if temp
result It is hot today";
if temp
result It is not so hot today";
Console.WriteLineresult;
d
Prompt the user to enter a temperature
Console.WriteWhat is the temperature today? ;
string input Console.ReadLine;
double temp double.Parseinput;
if temp
string result It is hot today";
if temp
string result It is not so hot today";
Console.WriteLineresult;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
