Urgent Help on MPH to KPH coding

I have to create a code to convert MPH to Kph.

I know the formula is Mph * 1.61

What do I need to correct?
#include <iostream>
#include <cstdlib>

using namespace std;

double ConvertToMPH (int MPH,);
double ConvertToMPH (double kph);

int main()
{

double MPH;

cout << "Please enter your MPH: ";
cin >> paceInMin;

return 0;
}

double ConvertToKPH(int MPH,)
{
return (MPH*1.61);
}

double ConvertToMPH(double kph)
{
return kph/1.61;
}
Last edited on
first of all i dont think the first template is necessary.
The outline of your code should be that:
1. The user inputs the speed in mph(double or float)
2. The speed in mph is passed to the converter(function)
3. The output(speed in kph) is then displayed.

Use this as a template:
1
2
3
4
5
6
7
8
9
10
11
12
13
int increment(int i){
  return ++i;
}

int main(){
  int x;

  cout<<"Enter an integer: ";
  cin>>x;
  cout<<"\nOutput is: "<<increment(x);

  return 0;
}
Topic archived. No new replies allowed.