Guys and gals I need help with this program. I've done alot of research trying to figure out the errors that keep popping up. Mainly on lines 249 and 250. If anyone has a solution it would be greatly appreciated. Thanks!
int funcOne(int, int); //1
int funcTwo(int, int); //2
long double funcThree(long double, int, int); //3
int funcFour(int, int); //4
long double funcFive(string, string, string, long double, int); //5
long double funcSix(string, long double, int); //6
int addTen(int, int);
void isPrime(int, int);
void validInput();
void cleanup();
int main()
{
int randNum, choice, choice2, divisor;
int currentNum;
int doubledNum;
long double reversedNum = 0;
long double poweredNum;
int sumOfNum = 0;
string firstToSecond, num1, num2;
string secondToThird;
long double twoDigitPowered, threeDigitPowered;
int add;
START:
cout << fixed << showpoint << setprecision(2) << endl;
cout << "The following random number is generated: ";
addTen(currentNum, add);
currentNum = addTen(currentNum, add);
}
isPrime(currentNum, divisor);
break;
case 6:
{ cout << "First two digits raised to the third digit = "
<< funcSix(secondToThird, threeDigitPowered, currentNum)
<< "\n\n";
currentNum = funcSix(secondToThird, threeDigitPowered, currentNum);
addTen(currentNum, add);
currentNum = addTen(currentNum, add);
}
isPrime(currentNum, divisor);
break;
case -1:
goto START;
default:
cout << "Invalid Choice!\n\n" << "Current Number: "
<< currentNum << "\n";
}
cleanup();
menuOptions();
cin >> choice;
cout << "\n";
} while (choice != 0);
return 0;
}
void menuOptions()
{
cout << "Enter the corresponding number with what you want to do with this: \n";
cout << "1: Double the number.\n";
cout << "2: Reverse the digits of the number.\n";
cout << "3: Raise the number to the power of 2, 3, or 4.\n";
cout << "4: Sum the digits of the number.\n";
cout << "5: If the number is a two digit number, then raise the first digit to the power of the second digit.\n";
cout << "6: If the number is a three digit number and the last digit is less than or equal to 4, then raise the first two digits to the power of the last digit.\n";
cout << "-1: Reset Random Number.\n\n";
cout << "0: Terminate the program.\n\n";
cout << "Enter: ";
}
//Random Number Generator
int randomNumGenerator(int randNum)
{
while (randNum < 10 || randNum > 100)
{
srand(static_cast <unsigned int> (time(0)));
randNum = rand() % 100;
}
return randNum;
}
//Choice 1:
int funcOne(int doubledNum, int currentNum)
{
doubledNum = currentNum * 2;
return doubledNum;
}