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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started