I know we haven’t started on the difficulty portion yet, but i went ahead and declared and initialized them anyway aha.
#include<iostream>
int main()
{
std::cout << "Find and enter the correct codes to bypass the firewall." << std::endl;
int difficulty = 1; //Difficulty level
const int maxDifficulty = 10; //Highest difficulty level
const int CodeA = 20;
const int CodeB = 5;
const int CodeC = 10;
const int CodeSum = CodeA + CodeB + CodeC;
const int CodeProduct = CodeA * CodeB * CodeC;
std::cout << "Security level: " << difficulty << std::endl;
std::cout << "There's 3 numbers in the code." << std::endl;
std::cout << "The codes add up to: " << CodeSum << std::endl;
std::cout << "The codes mutltiply by: " << CodeProduct << std::endl;
int GuessA, GuessB, GuessC;
std::cout << "First Code: ";
std::cin >> GuessA;
std::cout << "Second Code: ";
std::cin >> GuessB;
std::cout << "Third Code: ";
std::cin >> GuessC;
int GuessSum = GuessA + GuessB + GuessC;
int GuessProduct = GuessA * GuessB * GuessC;
if(GuessSum == CodeSum && GuessProduct == CodeProduct)
{
std::cout << "Congrats!";
}
if(GuessSum != CodeSum && GuessProduct != CodeProduct)
{
std::cout << "Hold this L";
}
return 0;
}