fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. float state1 = 0;
  7. float state2 = 0;
  8. float total = 0;
  9. float commission = 0;
  10. cout<< "Enter sales in state1" <<endl;
  11. cin>>state1;
  12. cout<< "Enter sales in state2" <<endl;
  13. cin>>state2;
  14. cout<< "Enter the commission rate" << endl;
  15. cin >> commission;
  16. total = state1 + state2;
  17. total = total * commission;
  18. cout<< "Total commission on the sales of state 1 and state 2 is "<<total;
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 2988KB
stdin
1500
1500
0.05
stdout
Enter sales in state1
Enter sales in state2
Enter the commission rate
Total commission on the sales of state 1 and state 2 is  150