// Decide which company to ship with for several packages #include using namespace std; double calcSpeedy(int,char); // names of variables optional double calcReliable(int wt, char overNite); void chooseShipper(double s, double r); int main() { double speedy, reliable; // local, available only to main int pounds; // used for weight of package char rush; // 'Y' for overnight, 'N' if no rush cout<<"Send overnight? Y or N (Q to quit):"; cin>>rush; while (rush != 'Q' && rush != 'q') { cout<<"Enter weight of package in pounds:"; cin>>pounds; speedy = calcSpeedy(pounds,rush); reliable = calcReliable(pounds,rush); chooseShipper(speedy,reliable); cout<<"Send overnight? Y or N (Q to quit):"; cin.ignore(100,'\n'); cin>>rush; } // while return 0; } // main double calcSpeedy(int wt, char overNite) { // calculate cost to ship with Speedy if (overNite == 'Y' || overNite == 'y') { if (wt <= 30) return 10.00; else if (wt<=70) return 20.00; else return 0.00; } // overNite else return 0.50 * wt; } // calcSpeedy double calcReliable(int wt, char overNite) { // calculate cost to ship with Reliable if (overNite=='Y' || overNite=='y') return 7.00 + 0.20 * wt; else return 5.00 + 0.10 * wt; } // calcReliable void chooseShipper(double s, double r) // Print which shipper and cost. // Remember that 0 for Speedy is not accepted! { if (s == 0 || r