-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule2LABWeek2Option2.cpp
More file actions
36 lines (29 loc) · 1.15 KB
/
Copy pathModule2LABWeek2Option2.cpp
File metadata and controls
36 lines (29 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//************************************************************************
// Author: Rolando Carreon
// Date: feb 13 2025
// Language: C++
// Assignment: Module 2 LAB Week 2 - Option 2
// Description: The objective of this assignment is to build familiarity
// with basic C++ concepts such as user input, output, and
// conditional statements. In this assignment, I will be
// creating a text-based door guessing game where the player
// needs to guess the correct door to find a treasure.
//************************************************************************
#include<iostream>
using namespace std;
int main()
{
// declare local variables
int correctDoor = 2;
int playerChoice;
cout << "There are three doors in front of you.\n"
<< "They are numbered 1 - 3\nWhich door do you want to open? ";
cin >> playerChoice;
if (playerChoice == correctDoor) {
cout << "Congradulations - you found the treasure!!!\n";
} else {
cout << "Sorry - you found nothing behind the door.\n";
}
cout << "\nThank you for playing\n" << endl;
return 0;
}