/* A solution to COM1100 Quiz #3 (code 3qa7) * by Professor Futrelle, 10/22/2000 */ #include <iostream> using namespace std; // function prototypes; adding parameter names not necessary void doComps(float MULT, float addend, float divis); void printResult(int result); int main() { const float MULT = 2.0e2; float addend, divis; cout << "\nFor computing ((3 + addend) / divisor) * MULT\n" << "please enter the addend and divisor: "; cin >> addend >> divis; doComps(MULT, addend, divis); return 0; } // function definitions void doComps(float MULT, float addend, float divis) { int intResult; intResult = ((3 + addend) / divis) * MULT; printResult(intResult); } void printResult(int result) { cout << "\nThe integer value of the result is: " << result << "\n\n"; } /* running code produces this, with user input of 7.0 and 2.0: For computing ((3 + addend) / divisor) * MULT please enter the addend and divisor: 7.0 2.0 The integer value of the result is: 1000 */