Question: declare an int var to hold a temperature, accept the temperature as input declare a String Variable such as condition and accept input as S

declare an int var to hold a temperature, accept the temperature as input

declare a String Variable such as condition and accept input as S for sunny

use nested if as follow:

if(temperature > 85)

{

output it is hot

use if(condition.Equal("S"))

      {

          output "sunny"

      }

else {output "cloudy"

}

else

{

   output temperature is not hot

}

Step by Step Solution

3.59 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!