1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
alisha [4.7K]
3 years ago
10

You decide to buy some stocks for a certain price and then sell them at anotherprice. Write a program that determines whether or

not the transaction wasprofitable. Here are the details:• Take three separate inputs: the number of shares, the purchaseprice of the stocks, and the sale price, in that order.• You purchase the number of stocks determined by the input.• When you purchase the stocks, you pay the price determined by the input.• You pay your stockbroker a commission of 3 percent on the amount paid forthe stocks.• Later, you sell the all of the stocks for the price determined by the input.• You pay your stockbroker another commission of 3 percent on the amountyou received for the stock.Your program should calculate your net gain or loss during this transaction andprint it in the following format:If your transaction was profitable (or if there was a net gain/loss of 0) print:"After the transaction, you made 300 dollars."(If, for example, you gained 300 dollars during the transaction.)If your transaction was not profitable, print:"After the transaction, you lost 300 dollars."(If, for example, you lost 300 dollars during the transaction.)Use string formatting.
Computers and Technology
1 answer:
Otrada [13]3 years ago
7 0

Answer:

no_of_shares = int(input("Enter the number of shares: "))

purchase_price = float(input("Enter the purchase price of the stock: "))

sale_price = float(input("Enter the sale price of the stock: "))

total_stock_price = purchase_price*no_of_shares

total_spend_on_buying = total_stock_price + (0.03*total_stock_price)

total_sale_price = sale_price*no_of_shares

commission_while_selling = total_sale_price*0.03

net_gain_or_loss = total_sale_price - (total_spend_on_buying + commission_while_selling)

if(net_gain_or_loss<0):

print("After the transaction, you lost {} dollars".format(abs(net_gain_or_loss)))

else:

print("After the transaction, you made {} dollars".format(abs(net_gain_or_loss)))

You might be interested in
______ are used to store all the data in a database.
e-lub [12.9K]

Answer:

C. Fields

Explanation:

Fields are used to store all the data in a database.

6 0
3 years ago
Fiber optic cables transfer data at the speed of light, so they have the __________ latency. This results in the ________ connec
Stella [2.4K]

Answer:

B. Fiber optic cables have the lowest latency with the highest connection

Explanation:

Latency is the delay before a transfer of data begins following an instruction for its transfer. In other words, the higher the latency, the slower the connection. Fiber optic cables transfer data at the speed of light however, which is incredibly fast. Thus, fiber optic cables have the lowest latency with the highest connection.

3 0
3 years ago
Check My Work _____ are made in response to situations that have occurred frequently enough to enable managers to develop decisi
enot [183]

Answer:

a. Programmed decisions

Explanation:

We basically have two types of decision:

  • Programmed decision
  • Non-Programmed decision

Programmed Decision: used for frequent situations of the organization; both internal and external. This decision results in the formulation of rules, procedures, and policies that can be applied in the future.

Non-Programmed Decision: used for unique and ill-structured situations of the organization; both internal and external. They are one-shot decisions. They have been handled by techniques such as judgment, intuition, and creativity.

8 0
3 years ago
Vpns create a _____________ to transport information through public communications media.
Oxana [17]

They create a secure tunnel.

3 0
3 years ago
Try to crack the code:
ololo11 [35]

Answer:001101110010010100011011010110010011100100100000001100100100110001000010001101100100010100100000001101100100100001010001010101001101001010

Explanation:

i copied

3 0
2 years ago
Other questions:
  • The ____ contains methods that allow you to set physical properties such as height and width, as well as methods that allow you
    14·1 answer
  • The chemical symbol H represents which of the following elements?
    9·2 answers
  • 0x400C (in hexadecimal)?
    8·1 answer
  • What power brake uses vacuum from the engine to aid in brake application?
    6·2 answers
  • Write a program that inputs a time from the console. The time should be in the format "HH:MM AM" or "HH:MM PM". Hours may be one
    6·1 answer
  • Find a 95% confidence interval for the mean failure pressure for this type of roof panel.The article "Wind-Uplift Capacity of Re
    7·1 answer
  • Why is it difficult to convince top management to commit funds to develop and implement a Strategic Information System
    13·1 answer
  • Although your project has been accepted by the customer, the contract with the system vendor specifies that it will support the
    13·1 answer
  • In the following code: function drawCircle(radius, x, y, color) { var circle = new Circle(radius); circle.setPosition(x, y); cir
    7·1 answer
  • Create a text file content.txt and copy-paste following text (taken from Wikipedia) into it: A single-tasking system can only ru
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!