Not sure why part of the code isn’t posting, but this is what i have so far.
#include
int main()
{
//print story context
std::cout << std::endl;
std::cout << “You are R2-D2. Your friends have fallen into the trash compactor and the walls are closing in.”;
std::cout << std::endl;
std::cout << “Hack into the detention level mainframe by solving a series of puzzles before its too late!”;
std::cout << std::endl;
//Declare 3 number code
const int CodeA = 2;
const int CodeB = 3;
const int CodeC = 4;
const int CodeSum = CodeA + CodeB + CodeC;
const int CodeProduct = CodeA * CodeB * CodeC;
// Print CodeSum and CodeProduct to the terminal
std::cout << "+ There are 3 numbers in the code" << std::endl;
std::cout << "+ The codes add-up to: " << CodeSum << std::endl;
std::cout << "+ The codes multiply to give: " << CodeProduct << std::endl;
std::cout << std::endl;
int GuessA, GuessB, GuessC;
std::cin >> GuessA;
std::cin >> GuessB;
std::cin >> GuessC;
int GuessSum = GuessA + GuessB + GuessC;
int GuessProduct = GuessA * GuessB * GuessC;
if (GuessSum == CodeSum && GuessProduct == CodeProduct)
{
std::cout << "You've done it!";
}
else
{
std::cout << "Oh no! That isn't quite right.";
}
std::cout << std::endl;
return 0;
}