Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

<p>This program should calculate package shipping costs. The shipping company hs

ID: 3625991 • Letter: #

Question

<p>This program should calculate package shipping costs. The shipping company hsa the following discount percentages:<br /><br /><strong><span>Shipping Costs</span><span> </span><span>Discount %</span>&#160;</strong></p>
<p>$100 or les<span> </span>1.4%</p>
<p>$101.01 to $1000<span> </span>1.9%</p>
<p>$1000.01 to $2500<span> </span>2.6%</p>
<p>$2500.01 or more<span> </span>3.3%</p>
<p><strong><span>Package Types Shipping Costs</span></strong></p>
<p>1. T-Shirts: Cost is number of items * $2.75 per item. For optional overnight delivery, add $10.00. Optional insurance is 2% of the cost.</p>
<p>2. Computers: Cost is number of computers * $29.99 per computer. For optional overnight delivery, add $25.00. If virus software is needed, ad $19.99 per computer. The number of computers requiring the virus software should be passed to the appropriate method. If a printer is needed, add $99.99 for each printer needed. Optional insurance is 12% of the cost.</p>
<p>3. Food/Drink: Cost is number of ounces * $0.55 per ounce. For optional overnight delivery, add $19.00. If the food needs to be refrigerated, add $0.15 per ounce for the necessary dry ice. If the item is alcohol, an additional charge of $1.23 per ounce is required so that the inspectors do not drink the alcohol. Optional insurance is 7% of the cost.</p>
<p>4. A Package Type of your choice: Please include documentation (comment statements) stating how the costs should be calculated for your package type.&#160;</p>
<p>&#160;</p>
<p>For each package type, print out the name, address, city, state, and zip code for the customer. In addition, print out the date the package is expected to arrive along with the total cost after the discount is subtracted off. Please make sure to include output for each of the four package types.&#160;</p>
<p>Your program should use virtual functions including at least one pure virtual function with polymorphism. Your program should have one class for each package type along with a base-class that contains the appropriate data member and methods. An example of sample output for T-shirts could be:<br /><br />Customer: Mary Poppins<span> </span>Expected Arrival Date: 7-7-2011</p>
<p><span> </span>123 Fourth Street</p>
<p><span> </span>New York, NY 92405&#160;</p>
<p>&#160;</p>
<p>4 T-Shirts shipping cost is $11.00, overnight delivery is $10.00, no insurance specified.<br />Total Cost after discount is $20.71&#160;</p>

Explanation / Answer


//Ch5Lab5.cpp
//Dislays a shipping charge

#include
#include
#include
#include

using std::cout;
using std::cin;
using std::endl;
using std::string;
using std::getline;
using std::fixed;
using std::setprecision;
using std::transform;

int main()
{
string stateId = "";
double sale = 0.0;
double shipping = 0.0;

//enter input data
cout << "Two-character state ID: ";
getline(cin, stateId);
transform(stateId.begin(), stateID.end(),
stateId.begin(), toupper);
cout << "Sale amount: ";
cin >> sale;

//calculate shipping charge
shipping = sale * .01;
//add $5 to Tennessee shipments
if (stateId == "TN")
shipping = shipping + 5;
//end if

//display shipping charge
cout << fixed << setprecision(2);
cout << "Shipping: " << shipping << endl;

return 0;
} //end of main function

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote