Formal arguments are declared with the function A type (int, float, char, etc) must be included with the formal argument There may be 0, 1, or many arguments Function Definition Include declaration and body body should contain code to implement what their name describes (no more no less) – value-returning functions must have return statement Any variables used must be declared as arguments or local variables Write a complete declaration, fully specifying each formal argument Write the code for the function Function Arguments Write the declaration for each: Call the function DisplayMenu none void DisplayMenu() { a << endl; cout << “Choose menu option” cout << << endl; “1. Spanish” cout << << endl; “2. French” cout << << endl; “3. German” cout << << endl; “4. English” cout << << endl; “5. Exit” } CalcSquare num,square Square num
Formal arguments are declared with the function A type (int, float, char, etc) must be included with the formal argument There may be 0, 1, or many arguments Function Definition Include declaration and body body should contain code to implement what their name describes (no more – no less) value-returning functions must have return statement Any variables used must be declared as arguments or local variables Write a complete declaration, fully specifying each formal argument Write the code for the function Function Arguments Write the declaration for each: Call the function DisplayMenu none void DisplayMenu() { cout << “Choose a menu option” << endl; cout << “1. Spanish” << endl; cout << “2. French” << endl; cout << “3. German” << endl; cout << “4. English” << endl; cout << “5. Exit” << endl; } CalcSquare num,square Square num
funcexercises1.docx