67 069
Assignments Done
99,3%
Successfully Done
In November 2018

Answer to Question #29164 in C++ for Amoon

Question #29164
write a program that has tow converts function to convert a given number of millimeters into the equivalent length in meters and meters into into the equivalent length in millimeters.
Expert's answer
#include<iostream>
using namespace std;

float MillimeterToMeter(float mm);
float MeterToMillimeter(float m);

int main()
{
float meters = 11.5f;
cout<<meters<<" meters = "<<MeterToMillimeter(meters)<<" millimeters"<<endl;

float millimeters = 2900.0f;
cout<<millimeters<<" millimeters = "<<MillimeterToMeter(millimeters)<<" meters"<<endl;

return 0;
}

float MillimeterToMeter(float mm)
{
return mm/1000;
}
float MeterToMillimeter(float m)
{
return m*1000;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions