icyHot

Given two temperatures, return true if one is less than 0 and the other is greater than 100.

icyHot(120, -1) ? true
icyHot(-1, 120) ? true
icyHot(2, 120) ? false

public boolean icyHot(int temp1, int temp2) {
if((temp1 >100) && (temp2 <0)) return(true);
else if((temp1 < 0) && (temp2 > 100)) return(true);
return(false);
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s