Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Overview: File Preview d half of program 1 , you will modify your Overnight and TwoDay classes created in Program 1 A to inherit from
Overview:
File Preview d half of program you will modify your Overnight and TwoDay classes created in
ProgramA to inherit from a new base class called Package. As before, all class and function names will
be exactly as specified here, case included. You will now be submitting cpp and h files for classes, for
a total of files. You will write your own test driver to exercise and test these classes, but you will not
submit the test driver to me; I will have my own that your classes must compile and link with.
Fix any comments or errors cited by me on Program A but realize that you may not receive them until
the Tuesday before is due.
Modify the Overnight and TwoDay classes to inherit from Package. Some of the data and functions that
previously resided in both the Overnight and TwoDay classes will be moved to the Package class. Others
that pertain specifically to their particular type will remain with the individual derived classes. Still others
will override the base class version.
Changes include but are not limited to:
The use of constants to hold default values to be provided in the constructors or setters when
none or none valid is provided by the calling code. Check the style guide for the naming
convention of these constants.
The use of protected functions that can only be accessed by the derived classes not the calling
code.
The practice of derived classes overriding a function that the base class contains.
The practice of derived classes having an overload of a base class function that calls the base
class within.
The user of your software will be my test driver and the classes will not issue any output or request any
input except for the outputs specified in these requirements. Anything the test driver needs to know
will be asked in the form of calling a class function. It is the test driver's mine responsibility to print
data to the screen.
The cost of packages is now handled by each class. The base Package computes the base price of number
of ounces multiplied by the cost per ounce. As before, the TwoDay class adds a flat fee to that and
Oe it from scratch themselves.Overview:
File Preview d half of program you will modify your Overnight and TwoDay classes created in
ProgramA to inherit from a new base class called Package. As before, all class and function names will
be exactly as specified here, case included. You will now be submitting cpp and h files for classes, for
a total of files. You will write your own test driver to exercise and test these classes, but you will not
submit the test driver to me; I will have my own that your classes must compile and link with.
Fix any comments or errors cited by me on Program A but realize that you may not receive them until
the Tuesday before is due.
Modify the Overnight and TwoDay classes to inherit from Package. Some of the data and functions that
previously resided in both the Overnight and TwoDay classes will be moved to the Package class. Others
that pertain specifically to their particular type will remain with the individual derived classes. Still others
will override the base class version.
Changes include but are not limited to:
The use of constants to hold default values to be provided in the constructors or setters when
none or none valid is provided by the calling code. Check the style guide for the naming
convention of these constants.
The use of protected functions that can only be accessed by the derived classes not the calling
code.
The practice of derived classes overriding a function that the base class contains.
The practice of derived classes having an overload of a base class function that calls the base
class within.
The user of your software will be my test driver and the classes will not issue any output or request any
input except for the outputs specified in these requirements. Anything the test driver needs to know
will be asked in the form of calling a class function. It is the test driver's mine responsibility to print
data to the screen.
The cost of packages is now handled by each class. The base Package computes the base price of number
of ounces multiplied by the cost per ounce. As before, the TwoDay class adds a flat fee to that and
Overnight instead adds extra cost per ounce. The derived classes may call the base computation function
or compute it from scratch themselves.
Perform any error checking that might be necessary with arguments to functions or calculations made.
Also be sure to go by the style guidelines published in the "Programming Assignments" folder in Canvas.
Perform any error checking that might be necessary with arguments to functions or calculations made.
Also be sure to go by the style guidelines published in the "Programming Assignments" folder in Canvas.
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