Question: ifndef PACKAGE_H #define PACKAGE_H #include #include using namespace std; class Package { friend ostream public: Package ( const string &, const string &, const string

 ifndef PACKAGE_H #define PACKAGE_H #include #include using namespace std; class Package
{ friend ostream public: Package ( const string &, const string &,
const string &, const string &, int, const string &, const string
&, const string &, const string &, int, double = 0.0, double
= 0.0 ); Package& setSenderName(const string &); string getSenderName() const; Package& setSenderAddress(const
ifndef PACKAGE_H
#define PACKAGE_H
#include
#include
using namespace std;
class Package {
friend ostream
public:
Package ( const string &, const string &, const string &, const string &, int, const string &,
const string &, const string &, const string &, int, double = 0.0, double = 0.0 );
Package& setSenderName(const string &);
string getSenderName() const;
Package& setSenderAddress(const string &);
string getSenderAddress() const ;
Package& setSenderCity(const string &);
string getSenderCity() const;
Package& setSenderState(const string &);
string getSenderState() const;
Package& setSenderZipCode(int);
int getSenderZipCode() const;
Package& setRecipientName(const string &);
string getRecipientName() const;
Package& setRecipientAddress(const string &);
string getRecipientAddress() const;
Package& setRecipientCity(const string &);
string getRecipientCity() const;
Package& setRecipientState(const string &);
string getRecipientState() const;
Package& setRecipientZipCode(int);
int getRecipientZipCode() const;
Package& setWeight(double);
double getWeight() const;
Package& setCostPerOunce(double);
double getCostPerOunce() const;
double calculateCost() const;
private:
string senderName;
string senderAddress;
string senderCity;
string senderState;
int senderZip;
string recipientName;
string recipientAddress;
string recipientCity;
string recipientState;
int recipientZip;
double weight;
double costPerOunce;
};
#endif
ifndef TWODAYPACKAGE_H
#define TWODAYPACKAGE_H
#include "Package.h"
#include
#include
using namespace std;
class TwoDayPackage : public Package {
public:
TwoDayPackage( const string &, const string &, const string &, const string &, int, const string &, const string &,
const string &, const string &, int, double = 0.0, double = 0.0, double = 0.0 );
TwoDayPackage& setFlatFee( double );
double getFlatFee( ) const;
double calculateCost( ) const;
private:
double flatFee;
};
#endif

Concepts and Syntax Inheritance: creating a new class that absorbs (inherits) an existing class's capabilities, then customizes or enhances them. Base Class (also called parent class or superclass): the existing class Derived Class (also called the child class or subclass) : the new class is - a" relationship: phrase that indicates inheritance Private private members of a class are only accessible in the member functions of the class where they are defined. private members of a base class are inherited, but not directly accessible in a derived class. Public public members of a class are accessible in any function Class Hierarchy: a diagram showing the inheritance relationships among classes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!