// Mr. Minich
// Computer Science Using C++
// Ch. 9 Demo Program #5
// May 15, 2000 // purpose - to provide a means for demonstrating the Visual Studio // C++ Debugger.
#include <iostream.h> float computeTax(float); // computes & returns PA sales tax void watching(); // demonstrates danger of globals float watchThisGuy; // a global variable to "watch" with // the debugger int main() { float price = 0.0; // price of purchased float watchThisGuy = 5.0; // a local variable (in main) to be "watched" with the // debugger cout << "Enter the price: "; cin >> price; cout << "The amount of the tax is " << ComputeTax(price) << endl; cout << "watchThisGuy is " << watchThisGuy << " in main." << endl; cout << "watchThisGuy is " << watching << endl; return 0; }// end of main float computeTax(float a) { float amountOfTax = 0.0; // amount of PA sales tax float watchThisGuy = 9.9; // a local guy (in ComputeTax) to watch amountOfTax = 0.06 * a; // computing the sales tax watchThisGuy = 55.23456789; cout << "watchThisGuy is " << watchThisGuy << " in computeTax." << endl; return amountOfTax; }// end of computeTax void watching() { cout << "watchThisGuy is" << watchThisGuy << "in watching." << endl; }// end of watching