All pastes #393188 Raw Edit

I like PINS

public cpp v1 · immutable
·published 2007-03-13 10:54 UTC
rendered paste body
#include <iostream>int main() {    //Customise how cout returns numbers.    std::cout.setf(std::ios::fixed); //Make cout use fixed point notation.    std::cout.setf(std::ios::showpoint); //Decimals must always be displayed.    std::cout.precision(2); //Show two numbers after the decimal point.        //Declare the variables to be used.    unsigned short quantity;    float price, taxRate;        //Asign values to the variables.    quantity = 3;    price = 19.95;    taxRate = 0.05;        //Print some introductory text.    std::cout << "-Widget cost calculator-\n";    //Print the variables    std::cout << "The cost of purchasing "<< quantity <<" widget(s) at a price"                 " of $"<< price <<", with tax, comes to $";        //Print the calculation.    std::cout << ((quantity * price) + ((quantity * price) * taxRate)) << "\n";        //Let the user see the result, and tell them how to terminate the program.    std::cout << "Please press enter, or return to close the program";    std::cin.get();    //Return 0 to let the compuer know there were no errors running the program.    return 0;}