Question: C++ Visual Studio I need to add a loop to this application (at the end): Trade Size Commission Rate Under $2,500 $30 + 1.7% $2,500
C++ Visual Studio
I need to add a loop to this application (at the end):
| Trade Size | Commission Rate |
| Under $2,500 | $30 + 1.7% |
| $2,500 - $6,250 | $56 + 0.66% |
| $6,250 - $20,000 | $76 + 0.34% |
| $20,000 - $50,000 | $100 + 0.22% |
| $50,000 - $500,000 | $155 + .0.11% |
| Over $500,000 | $255 + 0.09% |
int main() { float commission, value; printf("Enter value of trade: "); scanf_s("%f", &value); if (value < 2500.00f) { commission = 30.00f + .017f * value; } else if (value < 6250.00f) { commission = 56.00f + .0066f*value; } else if (value < 20000.00f) { commission = 76.00f + .0034f*value; } else if (value < 50000.00f) { commission = 100.00f + .0022f*value; } else if (value < 50000.00f) { commission = 155.00f + .0011f*value; } else { commission = 255.00f + .0009f*value; } printf("Commission: $%.2f ", commission); return(0); }
...so that the user can enter more than one trade and the program will calculate the commission on each. The program should terminate when the user enters (0) zero as the trade value: Enter value of trade: 30,000 Commission: 166.00
Enter value of trade: 20,000 Commission: 144.00
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
