The variable
measure
is defined, and only exists, in the
whatmeasure
function. And the same with
find
and
whatfind
. So you need to change your functions to return their values, and change
main
to pass the relevant values to the functions. Somethoing like:
#include <iostream>
using namespace std;
string whatmeasure () {
string measure;
cout << "mm = millimeters \n" << "cm = centimeters\n"
<< "dm = decimeters\n"
<< "m = meters\n"
<< "km = kilometers\n"
<< "Your value is in: " ; cin>> measure;
return measure; }
string whatfind () {
char find;
cout << endl << "r = radius of the circle\n" << "d = diameter of the circle\n"
<< "a = area of the circle\n"
<< "l = kreisumfang\n"
<< "You need to find: "; cin >> find;
return find; }
string howround (string measure) {
string answerneedround;
cout << "Do you want to round the answer? (yes/no)\n";
cin >> answerneedround;
if (answerneedround == "yes") {
cout << "To decimal places or nearest " <<measure; }
return rounding;
}
int main() {
string measurement = whatmeasure ();
string tofind = whatfind();
string roundingunit = howround (measurement);
return 0;
}