When i want something to ask me do i want to start again i use a simple loop
Code:
while (again == 'y')
{
cout<<"Do you want to play again? (y/n)"<<endl;
cin>>again;
}
Just wrap it around your whole program, im sure i will get slated for this method but it works and if it aint broke dont fix it!
Code:
#include <iostream>
using namespace std;
int main() {
while (again == 'y')
{
for (;;)
{
double f;// feet
double m; // meters
cout << "Enter the length in feet: " ;
cin >> f; // reads number of feet
m = f / 3.28; //Converts feet to meters
cout << f << " feet is " << m << " meters.\n" ;
system("pause");
}
cout<<"Do you want to play again? (y/n)"<<endl;
cin>>again;
}
return 0;
}