C++ program for share market game.
The user starts with a cash of $1,000.00, and each day has the option to: (B)uy, (S)ell, (H)old or (Q)IT options should be error-checked and the user re-prompted if incorrect
There is only one fund traded on this exchange (an index fund), and its starting share price is $1.00. Each day, the price varies randomly up, down or steady. The new share price is the old one multiplied by 0.5, 1.0, 1.5 or 2.0 (with equal/random probability). The user transacts in the morning, the share price changes, then the user is presented with their details for the end of the day:
Buy, (buy amount divided by share price).
Sell, (sell amount divided by share price).
program must error-check the buy and sell amounts so that they can’t spend more than they have (or less than $0), and they can’t sell more than they have (or less than $0). Re-prompt the user if their input is incorrect.
If a user chooses to Hold, then the share price is adjusted and accordingly the share account balance.
When the user chooses to Quit, all of their shares are sold at the current price and they receive a final report with the number of days they were in the market, the final balance, the total profit or loss they made and the average profit/loss per day. If they quit on the first day, then this is zero days and they get a farewell message but no report.
some one Plz help me on this by coding full program on the above mentioned description
The user starts with a cash of $1,000.00, and each day has the option to: (B)uy, (S)ell, (H)old or (Q)IT options should be error-checked and the user re-prompted if incorrect
There is only one fund traded on this exchange (an index fund), and its starting share price is $1.00. Each day, the price varies randomly up, down or steady. The new share price is the old one multiplied by 0.5, 1.0, 1.5 or 2.0 (with equal/random probability). The user transacts in the morning, the share price changes, then the user is presented with their details for the end of the day:
Buy, (buy amount divided by share price).
Sell, (sell amount divided by share price).
program must error-check the buy and sell amounts so that they can’t spend more than they have (or less than $0), and they can’t sell more than they have (or less than $0). Re-prompt the user if their input is incorrect.
If a user chooses to Hold, then the share price is adjusted and accordingly the share account balance.
When the user chooses to Quit, all of their shares are sold at the current price and they receive a final report with the number of days they were in the market, the final balance, the total profit or loss they made and the average profit/loss per day. If they quit on the first day, then this is zero days and they get a farewell message but no report.
some one Plz help me on this by coding full program on the above mentioned description