It tells me error id returned 1 exit status when I try to run the code and have search it up from what i have seen is that you mostly get this error from misspelling main() function but that is not the case here.
#include <iostream>
#include <string>
using namespace std;
int main(){
double gallons();
double miles();
double meters();
char option;
cout<<"This program converts english units to metrics:"<<endl;
cout<<"--------------------------------------------------"<<endl;
cout<<"--------------- Select any option ----------------"<<endl;
cout<<"press g to convert gallon to liters"<<endl;
cout<<"press m to convert miles to kilometers"<<endl;
cout<<"press f to convert meters to feet"<<endl;
cin>>option;
if(option =='G' || option == 'g'){
gallons();
}
if(option =='M' || option == 'm'){
miles();
}
if(option =='F' || option == 'f'){
meters();
}
gallons();{
double gallon;
cout<<"Enter the amount of gallon you want to convert to liters"<<endl;
cin>>gallon;
gallon = gallon * 3.78541;
cout<<"You have "<<gallon<<" liters"<<endl;
}
miles();{
double mile;
cout<<"Enter the miles covered that you want to convert to kilometers"<<endl;
cin>>mile;
mile = mile * 1.60934;
cout<<"You have covered "<<mile<<" kilometers"<<endl;
}
meters();{
double meter;
cout<<"How many meters do you want to convert to feet?"<<endl;
cin>>meter;
meter = meter * 3.28084;
cout<<"You have covered "<<meter<<" kilometers"<<endl;
}
return (0);
}
This is the end of the code.