Can you give me a hand with this? I have no clue as to what I'm doing
Code:
//Displayes user input //Verison 1. //Overloaded programmer-defined functions. //One function will have value parameters and a return value. //One function will have reference parameters and a void return. Use function prototypes. //A while or for loop. //An if..else or switch decision. //No global variables. //Optionally include default parameter(s). //MS Visual Studio Academic Edition #include <iostream> using namespace std; int addition (int a, int b) { int r; r=a+b; return (r); } int main () { int z; z = addition (5,3); cout << "The result is " << z; return 0; } int FindArea(int length, int width); //function prototype (declaration) int main() { int lengthOfYard; int widthOfYard; int areaOfYard; std::cout << "\nHow wide in feet is your yard? "; std::cin >> widthOfYard; std::cout << "\nHow long in feet is your yard? "; std::cin >> lengthOfYard; areaOfYard= FindArea(lengthOfYard,widthOfYard); std::cout << "\nYour yard is "; std::cout << areaOfYard; std::cout << " square feet\n\n"; return 0; } int FindArea(int l, int w) // function definition { return l * w; }
Comment