I start where the last man left off.
- Thomas A. Edison
News
Site News
Latest Comments
Affiliates
Proxies
Contribute!
Chat
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
6,550
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
·
Open and Write System Call
·
Bit Multiplication
·
Hello World
·
Gross Pay
·
Fat Percentage
"AllSyntax.com" Copyright © 2002-2013; All rights lefted, all lefts righted.
Privacy Policy
|
Internet Rank