Question: Python, please! Mini sharesises algorithm. Buying shares Selling shares The price of shares of some company growing by x% The price of shares of some

Python, please!

Mini sharesises 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!