/*#include <iostream>
#include <string>
using namespace std;
class heartRates
{
string first;
string last;
int month;
int day;
int year;
int age;
int curyear;
int max;
double hi;
double lo;
int c;
public:
heartRates (string, string, int, int, int, int);
void setFirst(string);
void setLast(string);
void setMonth(int);
void setDay(int);
void setYear(int);
void setcuryear(int);
string getFirst();
string getLast();
int getMonth();
int getDay();
int getYear();
int getAge(int);
int getcuryear();
int getMaximumHeartRate();
double getTargetHeartRate(int);
void displayInfo(int, int);
};
*/
Above are my header file, code, and test code. The purpose is to, given the first name, last name, and DOB, calculate the maximum heart rate and target heart rate of an individual. I am getting an error that say "displayInfo does not take zero arguments but every time i try to put in an argument for the parameter I get "undeclared identifier" errors.
void heartRates::displayInfo(int hi, int lo, int y)
here you declare the "displayInfo" function which accepts three integers as parameters but in the main function you make a call for that function with zero arguments..
I thought that I had the solution, however, I have one last problem. When I run the program, the age, target heart range and maximum heart rate print out as decimals!!! i can still run the program but i get two errors in the function "set targetHeartRate(int max)" that say "double to int possible loss of data" i believe because I am multiplying by a decimal. How can I perform the same calculation and get the age, target heart range, and maximum heart rate to print as an integer to the screen?
/*#include <iostream>
#include <string>
using namespace std;
class heartRates
{
string first;
string last;
int month;
int day;
int year;
int age;
int curyear;
int max;
double hi;
double lo;
int c;
int y;
public:
heartRates (string, string, int, int, int, int);
void setFirst(string);
void setLast(string);
void setMonth(int);
void setDay(int);
void setYear(int);
void setcuryear(int);
void setAge(int);
void setTargetHeartRate(int);
void setMaximumHeartRate(int);
string getFirst();
string getLast();
int getMonth();
int getDay();
int getYear();
int getAge();
int getcuryear();
int getMaximumHeartRate();
int getTargetHeartRate(int);
void displayInfo();
};*/
i've tweaked it a bit in the header by changing double hi and double lo to int hi and int lo. Also, ive added int() around the calculations for hi and lo int the function definition for setTargetHeartRange() and setAge() but now i am getting some weird negative number for both values when i run the program (it is now error free according to the compiler). Im not sure if its the location of the value that is printing out instead of the value?
/#include <iostream>
#include <string>
usingnamespace std;
class heartRates
{
string first;
string last;
int month;
int day;
int year;
int age;
int curyear;
int max;
int hi;
int lo;
int c;
int y;
public:
heartRates (string, string, int, int, int, int);
void setFirst(string);
void setLast(string);
void setMonth(int);
void setDay(int);
void setYear(int);
void setcuryear(int);
void setAge(int);
void setTargetHeartRate(int);
void setMaximumHeartRate(int);
string getFirst();
string getLast();
int getMonth();
int getDay();
int getYear();
int getAge();
int getcuryear();
int getMaximumHeartRate();
int getTargetHeartRate(int);
void displayInfo();
};/