I know this question has been asked before, but the answers there don't seem to be related to the issue I'm having.
Here's my code
#include <iostream>
int main()
{
double E;
double R;
double t;
double C;
std::cout << "This program will calculate the current flowing through an RC curcuit!\n\n";
std::cout << "Please enter the power source voltage value in Volts: ";
std::cin >> E;
std::cout << "\n\n";
std::cout << "Please enter the total resistance value in Ohms: ";
std::cin >> R;
std::cout << "\n\n";
std::cout << "Please enter the time elapsed after the switch closed Seconds: ";
std::cin >> t;
std::cout << "\n\n";
std::cout << "Please enter the total capacitance value in Farads: ";
std::cin >> C;
std::cout << "\n\n";
double RC = R * C;
double ER = E / R;
double pow = -t / RC;
double expo = 2.71828 ** pow; //this line is the problem...
double I = ER * expo;
std::cout << "The current flowing through this circuit is: " << I;
return 0;
}
I really don't know what this means, despite looking it up on Google... Can someone please explain, generally, how to avoid this type of error and not just solve this particular instance of it?