Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions

Question

7. Where Do We Begin?

Answered: 1 week ago

Question

a. What is the purpose of the team?

Answered: 1 week ago