/* testsel1.cpp CIS 150 6/2/2005 David Klick Demonstration of if statement. */ #include #include using std::cout; using std::cin; using std::fixed; using std::setprecision; using std::showpoint; int main(void) { const double discPct = .15; char choice; double price = 12.00; cout << "Ticket Seller 2000\n\n" << "Tickets are $" << fixed << showpoint << setprecision(2) << price << " each.\n\n" << "Apply senior discount? (Y/N) "; cin >> choice; if (choice == 'Y' || choice == 'y') { price *= (1 - discPct); } cout << "The amount due is $" << price << '\n'; return 0; }