C++ float type Compute sales tax and display it with an appropriate message.

Description

C++ float type Compute sales tax and display it with an appropriate message.

#include <iostream>
using namespace std;
int main()/*from  w  w  w  .ja v a 2  s .c  o  m*/
{
   float sale, tax;
   float tax_rate = .08;    // Sales tax percentage
   sale = 22.54;
   // Compute the sales tax.
   tax = sale * tax_rate;
   // Print the results.
   cout << "The sales tax is " << tax << "\n";
   return 0;
}



PreviousNext

Related