Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started