Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Assignment CSC425

Name:MUHAMMAD NABIL BIN MAHADZIR


Class:2A4
#include <iostream>

using namespace std;

int main() {
string temperature;
string humidity;

cout << "Enter temperature";


cin >> temperature;
cout << "Enter humidity";
cin >> humidity;

if (temperature == "Warm") {
if (humidity == "Dry") {
cout << "play tennis" << endl;
} else if (humidity == "Humid") {
cout << "swim." << endl;
} else {
cout << "Error value." << endl;
}
} else if (temperature == "Cold") {
if (humidity == "Dry") {
cout << "play basketball." << endl;
} else if (humidity == "Humid") {
cout << "watch tv." << endl;
} else {
cout << "Error value" << endl;
}
} else {
cout << "Error value" << endl;
}

return 0;
}

You might also like