// extrafunction.cpp -- trying to add multiple functions and call them #include <iostream> #include <cmath> using namespace std ; double converted ( int yar ) { return 0.9144 * yar ; } int main () { char answer , y , n ; double meters ; int yards ; cout << "Would you like to convert yards to meters? (y/n)" << endl ; cin >> answer ; if ( answer == y ) { cout << "How many yards?" << endl ; cin >> yards ; meters = converted ( yards ); cout << yards << " yard(s) is equal to " << meters << " meter(s)." << endl ; } else { cout << "Have a great day!" << endl ; } cin . get (); cin . get (); return 0 ; }