Every day I get up and look through the Forbes list of the richest people in America. If I’m not there, I go to work.
- Robert Orben
News
Site News
Latest Comments
Affiliates
Proxies
Contribute!
Tutorials
Newest Articles
Most Popular
Highest Rated
Latest Comments
Code Samples
Newest Code
Most Popular
Highest Rated
Latest Comments
Blogs
Admins Blog
Newest Blogs
Most Popular
Highest Rated
Latest Comments
Forums
Latest Posts
Latest Topics
Memberlist
[login]
|
[Register]
Commission
by: bs0d
Description:
Visual C++ program will display the commission based on sales by user. Works with program defined function and if / else's.
Code:
//Displays the commission #include
using namespace std; //function prototype float calcCommission(int); int main() { int sales = 0; float commission = 0.0; //enter input data cout << "Enter sales: "; cin >> sales; if (sales > 0) { //calculate and display commission commission = calcCommission(sales); cout << "Commission: " << commission << endl; } else cout << "No commission calculated" << endl; //end if return 0; } //end of main function //*****program-defined functions***** float calcCommission(int amountSold) { //calculate and return commission float commDollars = 0.00; if (amountSold <= 100000) commDollars = amountSold * .02; else if (amountSold <= 400000) commDollars = 2000 + .05 * (amountSold - 100000); else commDollars = 17000 + .1 * (amountSold - 400000); //end ifs return commDollars; } // end of calcCommission function
No Comments for this page.
You Must be
signed in
or a
member
to comment.
Code Stats
4,903
Views
0
Total Comments
0
Rating of 5 (
Votes)
Code Options
·
Login to Rate This Code
·
Login to Post a Comment
·
Read more by this author
Related
·
Hello World
·
Shipping Charge
·
Fat Percentage
·
Bit Multiplication
·
Gross Pay
·
Grade
"AllSyntax.com" Copyright © 2002-2010; All rights lefted, all lefts righted.
Privacy Policy
|
Internet Rank
Credit Counseling
-
Credit Consolidation
-
Credit Card Consolidation
-
United Specialties