Ok,
My assignment is to create 2 functions, then call those functions from a menu. I have the menu part, and I think my functions are numerically correct but I get this error
warning C4700: uninitialized local variable 'ci' used
warning C4700: uninitialized local variable 'cc' used
Here is the program:
I can't figure out what it means --- when I run the program the menu come up right, but it will not run the funtion. :/Code:#include <iostream> #include <cmath> using namespace std; void ci2cc(double& cubinch) { double cc, ci; cc = ci*16.387064; } // cubic inch to cubic centimenter void cc2ci(double& cubcent) { double cc,ci; ci = cc/16.387064; } // cubic centimeter to cubic inch void main() { double cubinch, cubcent; int select; do { cout << " 0 : Exit the program. \n"<< " 2 : Convert Cubic inch to cc. \n" << " 3 : Convert cc to Cubic inch. \n";cout << "Please enter the selection : "; cin >> select; switch(select) { case 0 : cout << "Program teminates. \n"; break; case 1 : cout << "Please enter a value in cubic inches : "; cin >> cubinch; ci2cc(cubinch); cout << "" << cubinch << " cubic inch = " << cubcent << " cubic centimeter " << endl; break; case 2 : cout << "Please enter a value in cubic centimeters : "; cin >> cubcent; cc2ci(cubcent); cout << "" << cubcent << " cc = " << cubinch << " Cubic inches " << endl; break; default : cout << "Invalid selection.\n"; } // switch }while(select != 3); } // main
Thanks in advance!
Jessica



LinkBack URL
About LinkBacks


