Activity - Decision-Making Adventure
Activity - Decision-Making Adventure
Objective:
To practice writing decision-making statements using if, if-else, else-if, and switch-case
statements in C++.
Instructions:
1. Scenario: You are creating a simple text-based adventure game where the player has to
make decisions based on different conditions.
2. Problem 1: Using if statement
Write a program that asks the user for their age and prints whether they are a child (under
12), a teenager (12-18), or an adult (19 and above).
Example:
o If the age is 15, the program should output: "You are a teenager."
3. Problem 2: Using if-else statement
Write a program that asks the user if they want to go to the cinema or stay at home. If the
user chooses "cinema," print a message saying "Enjoy the movie!" If the user chooses
"home," print "Enjoy your time at home!"
o If the user types something else, output "Invalid input!"
4. Problem 3: Using else-if statement
Write a program that asks the user to input a number between 1 and 7 (inclusive), and
print the name of the corresponding day of the week (1 = Sunday, 2 = Monday, etc.). If
the user inputs a number outside the range, print "Invalid number!"
Example:
o If the user enters 3, the program should output: "Wednesday."
5. Problem 4: Using switch-case statement
Write a program that asks the user to choose a number between 1 and 5 and displays a
different message based on the number chosen:
o 1: "You chose the first option!"
o 2: "You chose the second option!"
o 3: "You chose the third option!"
o 4: "You chose the fourth option!"
o 5: "You chose the fifth option!"
o For any number outside the range, output: "Invalid choice."
Requirements: