so im trying to write code for this.
One large chemical company pays its salespeople on a commision basis.The sales people receive $200 per week plus 9 percent of their gross sales for the week ( found on net)
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
I'd recommend using the 'double' type for your floating point variables, and initializing them before use. You didn't specify a value for the 'sales' variable before using it, so the program just displayed the "garbage" from the last time it was used. Try doing something like this.
1 2
double salary = 0;
double sales = 0;
It would also be so much easier to just do this to get the value of 'sales' instead of saving it into a string, and then putting the string into the 'sales' variable. You don't have to include the 'sstream' file, or the 'string' file this way, too!
1 2
cout << "enter no of sales" << endl;
cin >> sales;