Question: Python please! Mini sharesies algorithm. Buying shares Selling shares The price of shares of some company growing by x% The price of shares of some
Python please!
Mini sharesies algorithm.
Buying shares
Selling shares
The price of shares of some company growing by x%
The price of shares of some company decreasing by x%
All clients have zero balance to start with
Shares for all companies are just $1
All clients are from the same X bank
Input: A file containing the following: buy client company value, sell client company value, price raise and price fall, balance client (shows client's balance)
The first line contains a number which shows the number of operations to be performed
Test case:
3
BUY pet67 hse_econ 100000
PRICE_RAISE hse_econ 0.5
BALANCE pet67
Output: 100500
Input:
5
BUY pet67 hse_econ 100000
PRICE_FALL hse_econ 10
SELL pet67 hse_econ 10000
PRICE_RAISE hse_econ 30
BALANCE pet67
Output:
105300
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
