// // Example Use of the Shopping Cart Class // // input: none. // output: results of executing some sample functions. // // Oldham, Jeffrey D. // 2000Feb07 // CS1321 // // Modified by: // Massingill, Berna L. // 2001Sep // Example Use of the Shopping Cart Class #include #include // has EXIT_SUCCESS #include #include "shoppingCart.h" using namespace std; int main() { // Create the shopping cart (not specifying a name). shoppingCart sc; // To create a shopping cart and give your name: // shoppingCart sc("Your Name Here"); const double budget = 250.00; // how much we can spend // Add items to the shopping cart. sc.insert("Pepsi", 2.99); sc.insert("Pepsi", 2.99); sc.insert("Pepsi", 2.99); sc.insert("tires", 129.99); // Print what is in the shopping cart. cout << "So far our shopping cart has:\n" << sc << endl; // Keep shopping if we have not exceeded our budget. if (sc.totalSoFar() < budget) { sc.insert("windshield", 185.00); sc.insert("pad II textbook", 71.00); } // Obtain the 10% discount for Trinity students. sc *= (1-0.10); // Buy the items, specifying a credit card number. sc.checkout("1234 5678 8765 4321"); // Shopping cart automatically destroyed. return EXIT_SUCCESS; }