MY CODE >> Billing Calculator
/*

    Tommy Martin
    Internet
    This program is meant to calculate a user's monthly bill and test whether a 
	different service package would work better for them.

*/

#include<iostream>
#include<iomanip>

using namespace std;

int main () {

    /*

        Declaring Constants...
        These variables do not need be to changed thoughout the life of the program.

    */
    const double PACK_A_RATE = 9.95, PACK_A_EXCESS = 2, PACK_A_HOURS = 10;
    const double PACK_B_RATE = 14.95, PACK_B_EXCESS = 1, PACK_B_HOURS = 20;
    const double PACK_C_RATE = 19.95;

    /*

        Declaring Variables...
        These variables will be used throughout the program for different things.

    */
    double hours, excessHours, excessTotal, total;
    char __package;

    // This message is being dispalyed to give the user an idea of how to use the program.
    cout << "Internet Service Provider - Expected monthly bill \n\n"
         << "Package A: $9.95 per month with 10 hours of access.\nAdditional hours are $2.00 per hour \n\n"
         << "Package B: $14.95 per month with 20 hours of access.\nAdditional hours are $1.00 per hour \n\n"
         << "Package C: $19.95 per month with unlimited hours of access. \n\n";

    // This line asks for the user's input for what package they are using.
    cout << "Enter the letter of your plan (ex. A, B, C): ";    cin >> package;     cout << "\n";

    // A switch statement is used to recognize which package the user has selected.
    switch (package) {

        // The letters entered will be recognized as either upper or lower case.
        case 'a':   package = 'A';  // Setting the letter to upper case incase this variable is used later 
                                    // in the program
        case 'A':   cout << "Please enter the number of ours you used this month \n";
                    cin >> hours;   cout << "\n";   // Requesting user input for how many hours they have 
                                                    // used.

                    // if statement is used to ensure that the hours are within a reasonable margin.
                    if (hours < 0 || hours > 744) {

                        cout << "Invalid hour entry\nPlease enter a number between 0 and 744\n\n";
                        break;

                    }

                    // A different if statement is used to calculate if the user has gone over their plan's 
                    // allowed hours.
                    if (hours > PACK_A_HOURS)
                        excessHours = hours - PACK_A_HOURS;
                    else
                        excessHours = 0;

                    // These variables are calculating the user's total monthly charge based on their 
                    // monthly rates and any additional charges.
                    excessTotal = PACK_A_EXCESS * excessHours;
                    total = PACK_A_RATE + excessTotal;

                    // This line outputs the total monthly charge.
                    cout << "\nTotal amount due " << fixed << setprecision(2) << total << "\n\n";
                    break;

        // The letters entered will be recognized as either upper or lower case.
        case 'b':   package = 'B';  // Setting the letter to upper case incase this variable is used later 
                                    // in the program
        case 'B':   cout << "Please enter the number of ours you used this month \n";
                    cin >> hours;   cout << "\n";   // Requesting user input for how many hours they have 
                                                    // used.

                    // if statement is used to ensure that the hours are within a reasonable margin.
                    if (hours < 0 || hours > 744) {

                        cout << "Invalid hour entry\nPlease enter a number between 0 and 744\n\n";
                        break;

                    }

                    // A different if statement is used to calculate if the user has gone over their plan's 
                    // allowed hours.
                    if (hours > PACK_B_HOURS)
                        excessHours = hours - PACK_B_HOURS;
                    else
                        excessHours = 0;

                    // These variables are calculating the user's total monthly charge based on their 
                    // monthly rates and any additional charges.
                    excessTotal = PACK_B_EXCESS * excessHours;
                    total = PACK_B_RATE + excessTotal;

                    // This line outputs the total monthly charge.
                    cout << "\nTotal amount due " << fixed << setprecision(2) << total << "\n\n";
                    break;

        // The letters entered will be recognized as either upper or lower case.
        case 'c':   package = 'C';  // Setting the letter to upper case incase this variable is used later 
                                    // in the program
        case 'C':   excessHours = 0;
                    excessTotal = 0;

                    // There are no additional charges in package C so the total amount will be the total 
                    // manthly rate.
                    total = PACK_C_RATE;

                    // This line outputs the total monthly charge.
                    cout << "\nTotal amount due " << fixed << setprecision(2) << total << "\n\n";
                    break;

        // The default case is used to catch any unexpected user inputs.
        default: cout << "That is not a valid choice. \n Please type only the letter of you plan. 
                         \n Example: A, B, C \n\n"; break;

    }

    // This if statement is used to see if the user could have any cost saving by switching plans and 
    // outputs the result is cost savings are present.
    if (package == 'A' && total > 14.95) {

        if (total > 19.95)
            cout << "If you had upgraded to Package C you could have saved $" << fixed << 
                    setprecision(2) << total - 19.95 << "\n\n";

        else
            cout << "If you had upgraded to Package B you could have saved $" << fixed << 
                    setprecision(2) << total - 14.95 << "\n\n";

    }

    else if (package == 'B' && total > 19.95) {

        cout << "If you had upgraded to Package C you could have saved $" << total - 19.95 << "\n\n";

    }

    system ("pause");
    return 0;
}