Can anyone tell me what is coded wrong in this program for it to exit immediately after I enter the value for costShares? I have gone over and over and cannot seem to find anything that would cause this, but yet again am sure it is something obvious.
Add the following at line 29 and 30 to prevent the code from closing immediately:
1 2
int temp;
cin >> temp;
Also not sure if this is related to your problem, but you are using cin >> to get a string from the user. If the user inputs more than 1 word, it will cause lines in your code to skip over one another. To solve this, you could use the std::getline(cin, inputStringHere) to get a string from the user.
EDIT: Also make sure you've declared commisionRate somewhere otherwise your code won't run.
Okay thanks that is a start, here is what it looks like after adding variable for commisionRate; however I am still doing something wrong as it continues to end the program after I enter numberShares value