Code compiles and runs correctly, just need to have the 'total' keep adding to itself after the do you want to continue question. Right now it clears it everytime after it asks that question (Hopefully that makes sense)
#include <iostream>
using namespace std;
int main()
{
double length =0;
char operation;
double total = 0;
char answer = 'Y';
do
{
cout << "Please enter a length: ";
cin >> length;
cout << "(I)nches, (F)eet or (M)eters? ";
cin >> operation;
if (operation == 'M')
{
total = length ;
}
if (operation == 'F')
{
total = (length / 3.2808) ;
}
if (operation == 'I')
{
total = ((length / 12) * 3.2808);
}
cout << "The current total length is " << total<< " meters." << endl;
cout << " Do you want to continue (Y/N)? ";
cin >> answer;
}
while (answer == 'Y');
cout << "Goodbye!";
}