//nest2.cpp, nested ifs using boolean variables #include using namespace std; int main() { int temp; bool warm; char ans; bool weekend; cout << "What is the temperature? "; cin >> temp; warm = (temp > 70); cout << "Is it a weekend (y/n): "; cin >> ans; weekend = ((ans == 'y') || (ans == 'Y')); if (weekend) { cout << "wear black dress." << endl; } else { if (warm) cout << "Wear t-shirt."<< endl; else cout << "Wear sweater" << endl; } return 0; }