フィートとインチの長さを読み取り、メートルとセンチメートルの同等の長さを出力するプログラムを作成する必要があります。3つの関数を作成する必要があります。1つは入力用、1つ以上は計算用、もう1つは出力用です。また、ユーザーがプログラムを終了したいと言うまで、ユーザーが新しい入力値に対してこの計算を繰り返すことができるループを含めます。ある関数から入力を取得して変換関数で使用し、次の関数で出力することができないようです。それ、どうやったら出来るの?ありがとうございました。
#include <iostream>
#include <conio.h>
using namespace std;
double leng;
void length(double leng);
double conv(double leng);
void output(double leng);
int main()
{
length(leng);
conv(leng);
output(leng);
_getche();
return 0;
}
void length(double leng)
{
cout<<"Enter a length in feet, then enter a length in inches if needed: ";
cin>>leng;
return;
}
double conv(double leng)
{
return leng = leng * .3048;
}
void output(double leng)
{
cout<<"Your input is converted to "<<leng;
return;
}