#include <iostream>
usingnamespace std;
float loopCalculateSum(float sum,float userInput);
void showResults();
int main()
{
//Inititalize variable
float sum = 0;
float userInput = 0;
// Call to loop function
sum = loopCalculateSum(sum,userInput);
//Delay
char quitKey;
cout << "Press any key and Enter to end program: ";
cin >> quitKey;
//End of Program
return 0;
}
// Loop function
float loopCalculateSum(float sum, float userInput)
{
float userInput;
do {
cout << "Enter a postive number";
cin >> userInput;
sum = sum + userInput;
cin >> sum;
} while (userInput >= 0);
}