We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,478 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Deitel's 8th edition solution for 3.16

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...?

2
Contributors
3
Replies
5 Hours
Discussion Span
7 Months Ago
Last Updated
4
Views
Question
Answered
joey777
Newbie Poster
4 posts since Oct 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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.

BobS0327
Junior Poster
185 posts since Feb 2008
Reputation Points: 35
Solved Threads: 24
Skill Endorsements: 0
#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);
}
joey777
Newbie Poster
4 posts since Oct 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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.

BobS0327
Junior Poster
185 posts since Feb 2008
Reputation Points: 35
Solved Threads: 24
Skill Endorsements: 0
Question Answered as of 7 Months Ago by BobS0327

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0697 seconds using 2.81MB