This is a Length Converter that I made (i am a 14 yr old noob) and I would like to know if there is anything I need to fix or I should change to make it better.
Yes, sure...
Rather than using an infinite loop and then another loop within it and breaking it based on an if condition, use a single loop - get the user option as integer and switch on that integer. Exit the loop if the input does not match.
I am not too good at explaining like this... will post the code if u ask.
int main()
{
double f, m = 0.0;
int option = 0;
do
{
cout<<"Choose an option (Press any other key to quit) \n"
<<"1. Convert Feet to Meters \n"
<<"2. Convert Meters to feet \n";
cin>>option;
switch (option)
{
case 1 : cout<<"\nEnter Feet to be converted \n";
cin>> f;
m = f * 0.3048;
cout<< f << " feet = " << m << " meters \n";
break;
case 2 : cout<<"\nEnter Meters to be converted \n";
cin>> m;
f = m * 3.2808399;
cout<< m << " meters = " << f << " feet \n";
break;
}
}while (option == 1 || option == 2);
return 0;
}