SOURCE FILE: ex0502.cpp


// 
// Example 5.2.  Program to read a product's price and
// quantity sold and to display the total price
//

#include <iostream.h>
#include <iomanip.h>

int main(void)
{
   float price;          // price of product
   int   quantity;       // quantity of product sold
        
   cout << "Enter the price: ";
   cin  >> price;
   cout << "Enter the quantity sold: ";
   cin  >> quantity;

   cout << "The total price is $" << setprecision(2)
        << setiosflags(ios::showpoint | ios::fixed) 
        << price * quantity << endl;
   
   return 0;
}