Hi im working on a function lab that was givin to use, there are compile erros on it im not sure how to fix, most likely caused by mistakes by me not wrinting correctly. If you can help me out on this would be appreciated.
Discription:
The purpose of the lab is to ask the user to choose if they want to Power function or square root function. then have them enter in 1 number if power or 2 numbers if square root. Then call the functions to calc power or square root, display results and ask for new numbers.
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
//prototypes for functions for lab10
float Square_root(int);
void Base_exp(int, int);
int main()
{
//local constants
float Power = 0;
int Base_Exp1 = 0;
char Power_Num = 0;
char Square_Root_Num = 0;
//local variables
int Num1; //Squar root number
int Num2; //number for base
char Letter_code;
/***********************************************************/
cout << "Enter "P" for Power or "S" for Square Root";
cin >> Letter_code;
while (Letter_code = P || Letter_code = S);
{
if ( Letter_code = S);
{
cout << "Enter a number";
cin >> Num1;
//Call function to find Square root
float Square_root = Square_Root_Num = sqrt(Num1);
//Display Square root
cout << Square_root;
}
else if (Letter_code = P)
{
cout << "Enter in two numbers";
cin >> Num1 >> Num2;
//Call function to find Power number
void Base_exp (int, int) = Base_Exp1 = pow(Num1, Num2)
//Display Power number
cout << void Base_exp (int, int)
}
else break;
}
{
cout << "Enter "P" for Power or "S" for Square Root";
cin >> Letter_code;
}
end while
}
return 0;