Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Detailed Class Specifications TwoDay: The TwoDay class will contain the following private data: table [ [ string , name, table [ [ One

Detailed Class Specifications
TwoDay:
The TwoDay class will contain the following private data:
\table[[string,name,\table[[One string containing the recipient's full],[name. Give the value "Undefined" as a],[default if one is not provided by the user],[(calling code).]]],[string,address,\table[[One string containing the recipient's full],[address. Give a default value of "nowhere"],[if one is not provided by the user.]]],[float,Cost per ounce,\table[[The positive base cost per ounce to send],[any package by any shipping method]]],[int,Number of ounces,\table[[The positive number of ounces a package],[weighs to the nearest 1 ounce but has a],[minimum (and default) value of 6. If a],[number 6 is entered, change it to 6.]]],[float,Flat two-day fee,\table[[A positive flat fee added to the total base],[cost (above) for two-day expediting.]]]]
The TwoDay class will contain 2 constructors and one destructor. The destructor in this case will simply display a parting message (Ex: Good bye cruel world! You won't have Two Day shipping anymore!"). Feel free to be creative with the parting message. The constructors will be:
A default constructor with no arguments. It will provide default values to the member variables.
Another constructor will take 5 arguments which are, in order: string name, string address, integer number of ounces, float cost per ounce, float two day flat rate.
Both constructors will issue to the screen a welcome statement of your own (creativity welcome) that includes your made up shipper's name, package type and your name such as
"Welcome to We Gotchu Shipping, TwoDay package by Mrs. C. Delugach! In".
The TwoDay class will also contain the following public functions:
\table[[Function name,Return type,Argument(s),Description],[GetNameAndAddress (),string,none,\table[[Return the concatenation of the name],[variable, a space and the address],[variable.]]],[SetName(),void,string,\table[[Sets the contents of the name member],[variable.]]],[SetAddress(),void,string,\table[[Sets the contents of the address],[member variable.]]],[SetCostPer0z(),void,float,\table[[Applies the given cost per ounce],[variable to the associated member],[variable, error checking as necessary.]]]]
\table[[GetCostPer0z(),float,none,\table[[Returns the member cost per ounce],[value.]]],[GetNumOz(),int,none,\table[[Returns the contents of the member],[variable that holds the number of],[ounces the package weighs]]],[SetNumOz(),void,int,\table[[Sets the member variable for number of],[ounces to the provided value - making],[sure that it is at least 6.]]],[GetTwoDayFee(),float,none,\table[[Returns the member flat fee for two day],[shipping variable.]]],[SetTwoDayFee(),void,float,\table[[Applies the given two day fee to the],[associated member variable.]]],[CalculateTotalCost(),float,none,\table[[Calculates and returns the total cost to],[ship the package, which in this case is],[the number of ounces multiplied by the],[cost per ounce plus the flat two day fee.]]],[PrintInfo(),void,None,]]
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is meant by 'Wealth Maximization ' ?

Answered: 1 week ago