1>k:\cs1\bp\bp\runbp.cpp(12): error C2660: 'BP::ReportResult' : function does not take 0 argumentsCode://runBP.cpp #include "bP.h" int main() { BP test; test.GetPressure(); test.Average(); test.Test(); test.ReportResult(); return 0; }
Code://bP.h #include <iostream> using namespace std; const int SYSTOLIC_LIMIT = 140; const int DYSTOLIC_LIMIT = 90; class BP { public: //BP(); void GetPressure(); void Average(); bool Test(); void ReportResult(bool Result); void RunTest(); private: int firstDiastolic, secondDiastolic, thirdDiastolic; int firstSystolic, secondSystolic, thirdSystolic; double sysAvg, diaAvg; bool Result; };Hey guys, I am new to creating the 3 files (interface, application, and header) and can not figure out how to properly link test.ReportResult(); It needs an argument, and I have tried putting in (bool) (bool Result) and a couple of other things hoping I'd get lucky, but no dice. I can't find a specific example of this in my book, so if someone would be kind enough to help me out I'd really appreciate it.Code://bP.cpp #include "bP.h" #include <iostream> //------------------------------------------------------------------------------ void BP::GetPressure() { cout << "Please enter your Diastolic Pressure readings: "; cin >> firstDiastolic >> secondDiastolic >> thirdDiastolic; cout << "\nPlease enter your Systolic Pressure readings: "; cin >> firstSystolic >> secondSystolic >> thirdSystolic; cout << "Diastolic Pressure Readings: " << firstDiastolic << " " << secondDiastolic << " " << thirdDiastolic << endl; cout << "Systolic Pressure REadings: " << firstSystolic << " " << secondSystolic << " " << thirdSystolic << endl; } //-------------------------------------------------------------------------------- void BP::Average() { diaAvg = (firstDiastolic + secondDiastolic + thirdDiastolic) / 3; sysAvg = (firstSystolic + secondSystolic + thirdSystolic) / 3; cout << "Your average Diastolic(LIMIT = 90) Pressure is: " << diaAvg << endl; cout << "Your average Systolic(LIMIT = 140) Pressure is: " << sysAvg << endl; } //-------------------------------------------------------------------------------- bool BP::Test() { //bool Result = false; if ( diaAvg > 90 || sysAvg > 140 ) Result = true; cout << Result << endl; return Result; } void BP::ReportResult(bool Result) { cout << Result << endl; if ( Result == true ) cout << "Your blood pressure is too high, you should see your doctor!\n"; else cout << "Your blood pressure is not too high, congratulations! I recommend you get rechecked in 6 months.\n"; } void BP::RunTest() { }
Code is not polished up because it is still very much a work in progress, so the only thing I am asking about is the error code C2660. Thanks.



1Likes
LinkBack URL
About LinkBacks



I used to be an adventurer like you... then I took an arrow to the knee.