Answer to Question #150289 in C++ for Humanchecker

Question #150289
Write a program that examines the value of a variable call temp. then display the following messages, depending on the value assigned to temp.
Temperature Message
Less than 0 ICE
Between 0 and 100 WATER
Exceeds 100 STEAM
1
Expert's answer
2020-12-10T23:50:24-0500
#include <iostream>

int main() {
    int temp;
    std::cout << "Enter temp: ";
    std::cin >> temp;
    if (temp < 0) {
        std::cout << "ICE";
    }
    else {
        if (temp > 100) {
            std::cout << "STEAM";
        }
        else {
            std::cout << "WATER";
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog