#include <iostream> using namespace std; int getLength(int&); int getWidth(int&); double getArea(double lengthNum, double widthNum); void displayData(); int main(){ int length, width; getLength(length); getWidth(width); getArea(length, width); displayData(); system("pause"); return 0; } int getLength(int& lengthValue) { cout << "Enter the length: "; cin >> lengthValue; if (lengthValue < 0) { cout << "\nERROR: Enter a positive number.\n"; cout << "Enter the length: "; cin >> lengthValue; cout << endl; } return lengthValue; } int getWidth(int& widthValue) { cout << "Enter the width: "; cin >> widthValue; if (widthValue < 0) { cout << "\nERROR: Enter a positive number.\n"; cout << "Enter the width: "; cin >> widthValue; cout << endl; } return widthValue; } double getArea(double lengthNum, double widthNum) { return lengthNum * widthNum; } //ERROR in here please HELP....Thanks in advance :)! void displayData() { cout << "Rectangle Data\n"; cout << "--------------\n"; cout << "Length: " << getLength << endl; cout << "Width: " << getWidth << endl; cout << "Area: " << getArea << endl; }
getLength
getLength(&someIntObject)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)