Hello,
Here is my code up to if-else.
#include <iostream>
using namespace std;
int main()
{
cout << "You are a secret agent breaking into a server room..."<<endl;
cout << "Enter the correct code to continue..."<<endl;
const int CodeA = 8;
const int CodeB = 2;
const int CodeC = 4;
const int CodeSum = CodeA + CodeB + CodeC;
const int CodeProduct = CodeA * CodeB * CodeC;
cout << endl;
cout << "+ There are three numbers in the code" << endl;
cout << "+ The numbers add-up to " << CodeSum <<endl;
cout << "+ The code Multiply to give " << CodeProduct << endl;
int GuessA,GuessB,GuessC;
cin >> GuessA;
cin >> GuessB;
cin >> GuessC;
cout<<"You Entered: "<<GuessA<<GuessB<<GuessC << endl;
int GuessSum = GuessA + GuessB + GuessC;
int GuessProduct = GuessA * GuessB * GuessC;
if(GuessSum == CodeSum && GuessProduct == CodeProduct)
{
cout <<"You Win"<<endl;
}
else
{
cout <<"You Lost"<<endl;
}
return 0;
}