aaronkupen
Fully Optimized
- Messages
- 1,848
- Location
- Pittsburgh, PA
Code:
#include <stdio.h>
#include <iostream.h>
#include <stdlib.h>
#include <windows.h>
String information()
{
String sName;
cout << "Enter your name";
cin >> sName;
return sName;
}
int main(int nNumberofArgs, char* pszArgs[])
{
double dAccumulator;
do
{
cout << "Enter a digit to be added to the accumulator, if you get the accumulator to zero the program will exit";
double dInput;
cin >> dInput;
String sInfo;
dAccumulator = dAccumulator + dInput;
sInfo = information();
cout << sInfo;
cout << "'s accumulator is now ";
cout << dAccumulator;
}
while (dAccumulator != 0);
system("PAUSE");
return 0;
}