I would like to see how the solution 3.16 looks after it's all done. I've tried to run my program, but it won't run. Can someone please forward what it should look like before I run the program. I must be missing something...?

I must be missing something...?

Yep, you're definitely missing something such as the code to your program.

Post the code to your program that doesn't run.

#include<iostream>
using namespace std;

int main()
{
int HeartRates::getAge( int month, int day, int year )
{
    if(getBirthMonth() > month)
        return ((year - 1) - (getBirthYear()));
    if(getBirthMonth() == month)
        if(getBirthDay() > day)
            return ((year -1) - (getBirthYear()));
    return (year - (getBirthYear()));
}
int HeartRates::getMaximumHeartRate( int age )
{
    return (220 - age);
}

I would like to see how the solution 3.16 looks after it's all done.

No Problem! Unfortunately, YOU will have to write the complete solution from beginning to end in order to "see" the solution since this is apparently a homework assignment.

You should start at section 3.7 Separating Interface from Implementation section of your textbook. You must first define HeartRates class's interface by declaring all the function prototypes. An example to follow would be Gradebook.h header file in Figure 3.11. Thus, you'll create HeartRates.h header which will contain all your prototypes. Use the Gradebook.h as a guideline for creating your header file. Post the header file for review and possible suggestions for modification. Once the header file is acceptable, we'll continue onto the next step in writing your solution which would be the creation of HeartRates.cpp. This is where you would actually define all the functions declared in HeartRates.h.

This question has already been answered. Start a new discussion instead.