Program to calculate tax - c++, C/C++ Programming

Program to calculate tax:

float tax (float) ;

int main()

{

                float purchase, tax_amt, total;

                cout << "\nAmount of purchase: ";

                cin >> purchase;

 

                tax_amt = tax(purchase);

                total = purchase + tax_amt;

                cout.precision(2);

                cout << "\nPurchase is: " << purchase;

                cout << "\nTax: " << tax_amt;

                cout << "\nTotal: " << total;

 

                return 0;

}

float tax (float amount)

    {

        float rate = 0.065;

                return(amount * rate);

    }

Posted Date: 10/18/2012 7:55:15 AM | Location : United States







Related Discussions:- Program to calculate tax - c++, Assignment Help, Ask Question on Program to calculate tax - c++, Get Answer, Expert's Help, Program to calculate tax - c++ Discussions

Write discussion on Program to calculate tax - c++
Your posts are moderated
Related Questions
Floating  literal They can be written in common decimal as well as scientific notation (floating point representation). By default it is of type double. F, L is applied only to

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concate program 1 : package test

Program of function overloading: class vector{                 private :                 int v[3];                   public:                 /*friend istream &

Use 16 digit credit card numbers that contain 15 digits an 1 check digit. The format of the card number consists of the 15 digits followed by the check digit. The check digit is co

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome


Question: (a) (i) What is recursion? (ii) What advantage is there in its use? (iii) What disadvantage is there in its use? (b) The factorial of a positive number can b

C program to print R diagonal triangle: #define rows 3 #define cols 3 void main() {                 int i=0,j=0;                 int arr[rows][cols];

We are now quite happy to use the basic mathematical expressions, however in engineering we use scientific functions i.e Sin , Cos  , ln etc . Within C we have the following functi

Default assignment operator mange assigning one object to another object of the same class. It is member to member copy as shallow copy.