Trying to get this to run and it keeps stating I haven't initialized variables r and n. I'm just starting out, but I'm completely brain fried and any tips would be appreciated.
#include <iostream>
#include <cmath>
using namespace std;
int main() /* Problem number ten from page 200 from 4th Edition A First Book of C++*/
{
int count;
double a, r, n, total;
count = 0, total = 0;
cout << "\nThis program calculates the total sum of a geometric series.";
while (count <= n)
{
cout << "\nPlease enter the variables for the term, common ratio, and the number of terms for your series: ";
cin >> a, r, n;
total = total +(a *pow(r,n));
count++;
}
cout << "The total is " << total << endl; // this totals the sum of the variables