#include <iostream>
int main()
{
int health = 60;
int stamina = 35;
int acorns = 80;
bool bHasDungeonKey = true;
bool bIsStunned = false;
bool bHasMagicPotion = false;
// TODO: Create five bool variables
// using &&, ||, and ! operators.
bool bCanEnterDungeon = bHasDungeonKey && (health > 0);
bool bCanUseSpecialAttack = (stamina >= 50 ) || bHasMagicPotion;
bool bCanMove = !bIsStunned;
bool bCanBuyRareItem = (acorns >= 100) && (health > 0);
bool bCanEscape = (health > 0) && ((stamina >= 30) || bHasDungeonKey);
// TODO: Print all five results
// with descriptive labels.
std::cout << "Can Suni Enter Dungeon?: " << bCanEnterDungeon << "\n";
std::cout << "Can Suni Use Special Attack?: " << bCanUseSpecialAttack << "\n";
std::cout << "Can Suni Move?: " << bCanMove << "\n";
std::cout << "Can Suni Buy Rare Item?: " << bCanBuyRareItem << "\n";
std::cout << "Can Suni Escape?: " << bCanEscape << "\n";
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: