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
Whats in a computer?
kenny6666 [7]
A lot of things are in a computer there a motherboard, A cpu, A hard drive etc. A motherboard is the computer system  bascilly its the heart for a computer. The cpu is the the brain of a computer it controls on your computer and keeps it going good. finally a hard rive is the memory of your computer it stores all the data including files, photos, etc
8 0
3 years ago
Read 2 more answers
Question Workspace Check My Work Copying computer software, video games, movies, or music without paying the producer for them i
Tcecarenko [31]

Answer:

Option B, CUSTOMER MISBEHAVIOR.

Explanation:

Consumer misbehavior can defined as the behavioral acts by consumers which violate the generally accepted norms of conduct in consumption situations, and disrupt the order expected in such situations. Misbehavior by consumers disrupts the openness, impersonal trust, and orderliness of the exchange environment.

Some of the examples of customer misbehavior are: shoplifting, bending rules, breaking rules by ignoring warnings and using products in forbidden or ways not recommended...

* Routinized response behaviour is a type of purchasing scenario whereby the purchaser of a product or a service has past experience with purchasing it and automatically makes the decision to purchase again.

* Psychological influences refers to the workings of the mind or psyche that influences customer decisions.

* Social influences refers to the intentional and unintentional efforts to change another person's beliefs, attitudes, or behavior.

Therefore, the option that best suits the question is option B, CUSTOMER MISBEHAVIOR.

3 0
4 years ago
B. List any four major drawbacks of the first generation computer​
d1i1m1o1n [39]

Answer:

Terribly low storage space, limited to mathematics/computing, required entire rooms to use, and low information yield for hours of processing.

Explanation:

3 0
3 years ago
Is it possible to learn java s. and c# at the same time? if so I need help who can assist me.
Orlov [11]

Answer:

Both are imperative OOPS. They support classes and objects, and all OOPS features. And you need to learn the same concept in both cases. I am mentioning some of the toughest parts. They support multi-threading, both. And they also support exception handling. And you will find that both languages are different slightly. Also, the syntax of class, objects, inheritance, etc only differs a little. And that is why you can learn both at a time. And with a little more effort, you can learn c++ as well. And in fact, you should first learn C++, and then Java, C# and finally Python.

Explanation:

Please check the answer.

4 0
3 years ago
Please Help ASAP!!
Maurinko [17]

Answer:

in the page layout view

Explanation:

7 0
4 years ago
Read 2 more answers
Other questions:
  • What e-reader technology males a screen that is easy to read and extends battery life
    6·1 answer
  • Which security procedure is being demonstrated if an administrator is using Wireshark to watch for specific inbound and outbound
    10·1 answer
  • If you’re trying to reduce your debt, which of these expenses should you consider cutting out or cutting back on first?
    5·2 answers
  • A call center is a _______.<br><br> JIT<br><br> CMA<br><br> CIC<br><br> SFA
    8·1 answer
  • ____ technology is the same as that used in digital watches, or the time display on a microwave oven
    14·1 answer
  • Write a program that computes the minimum, maximum, average and standard deviation of the population over time for a borough (en
    6·1 answer
  • Create a cell reference in a format by typing in the cell name or
    12·1 answer
  • PLEASE HELP!
    5·1 answer
  • A web designer finds out after the launch that one of the external links did not have "http://' and therefore the link appeared
    6·1 answer
  • Essay:
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!