using std::cout;
using std::cin;
using std::endl;
void check_this(int x);
int main()
{
int i=1;
int total;//delared total variable
int in_var;
constshort MAX_N=20;
bool run_again;
do(run_again==true);
{
cout<<endl<<"What value would you like to stop the sum over the function x^5 + 10?"<<endl;
cin>>in_var;
while (in_var<1|| in_var>MAX_N)
{
cout<<"That value is invalid, please enter a value from 1 through "<<MAX_N<<endl;
cin>>in_var;
}
total=0;
for (int i=1; i<=in_var; i++)//loop statement
total += i;
cout<<"The total sum over " <<in_var<< " is " <<total<<endl;
cout<<"Would you like to try another value to sum up to?"<<endl<<"Enter 0 for no or 1 for yes. ";
cin>>run_again;
int value;
else(run_again==false)
{cout<<endl;}
}
return 0;
}