Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi, please help me with questions a), b) and c). Please use C++. Will rate. Thanks. C +Programming Question: Polymorphism Package packageID : int nameRecipent
Hi, please help me with questions a), b) and c). Please use C++. Will rate. Thanks.
C +Programming Question: Polymorphism Package packageID : int nameRecipent : string a addressRecipent: string a deliveryDate: Date a hasBeenDelivered: bool a weight: double rate : double o count: int e Package(int, string, string, double, double) : double OvernightPackage TwoDayPackage a flatFee: double a additionalFee: double OvernightPackageint, string, string, double, double, double) TwoDayPackage(int, string, string, double, double, double) double In order to calculate the shipping cost for an individual package, the various package classes of question 1 shall be extended by the following public member function double calculateCost () The function returns a double indicating the shipping costs of the package a) Provide specifications (.h file) and if needed implementations (.cpp file) of calculateCost )for the classes Package, TwoDayPackage, and OvernightPackage. The cost calculations are performed as follows: [6 marks] Class Package TwoDayPackage OvernightPackage weight (rate+ additionalFee) Cost Calculation Abstract (pure virtual) weight rate +flatFee The code snippet below defines a global array of pointers to objects that derive from the Package base class. #include #include #include #includeStep 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