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
Expalin the defference between the driver of a desktop and a laptop​
Pani-rosa [81]

Answer:

None, drivers are hardware specific, if both devices share the same hadware manufacurer they tend to have the same drivers.

A driver is a software component that lets the operating system and a device communicate with each other. So asking for a difference in drivers is as asking the difference in hardware in both devices, though one tends to be more intergrated they are all the same in low level functions

Also drivers might not even communicate directly with the device but send a request. thats why some drivers can be written directly into an operating system.

7 0
3 years ago
Which of these can be considered data?<br> A:facts<br> B:information<br> C:belief<br> D:all of these
IceJOKER [234]

A) facts.

Facts is the only thing that can be considered REAL data.

6 0
3 years ago
Explains why it is important to select the correct data when creating a chart
Liula [17]

Answer:

to be organized

Explanation:

<h2>because when you are organized to select the correct data, you won't confused </h2>
4 0
3 years ago
David writes the following at the start of his business plan: ""Computers are used by almost everyone in today’s tech-savvy worl
Ronch [10]

Answer:

Remove the statement as it does not communicate to new information

Explanation:

There are four possible advice to David, but only one advice he need to adopt.

  • Revise the statement , why computer are here to stay.
  • Reserve the statement for marketing section of business plan
  • Remove the statement
  • Keep the statement ,as it help in establish market size
3 0
4 years ago
Which two statements about using leased lines for your wan infrastructure are true? (?
Karo-lina-s [1.5K]
<span>The following statements are true: 1. Leased lines require little installation and maintenance expertise. ( A high service quality is offered by point-to point system) 2. Leased lines provide highly flexible bandwidth scaling. (This Allows a Constant availability)</span>
7 0
3 years ago
Other questions:
  • David needs to create a password. He uses "rtjjkliusfvwr." Which of the following best explains the weakness in his password?
    9·2 answers
  • What is a organisation in office technology
    7·1 answer
  • Explain briefly why people often have a pretty good understanding of computer hardware.
    14·1 answer
  • What allows user to double click with the mouse in a document to move the insertion point to a new location.?
    8·1 answer
  • Which of the following types of cloud platforms would a webmail service offered to the general public be considered?
    9·1 answer
  • Useful open source applications include the popular Web browser Mozilla Firefox, the e-mail application Thunderbird, the relatio
    7·2 answers
  • Given two integers as user inputs that represent the number of drinks to buy and the number of bottles to restock, create a Vend
    10·1 answer
  • The math club starts with 5 members. Five months later, their membership has grown to 50 members.
    5·2 answers
  • What is the full form of the OS?​
    15·2 answers
  • A large, closet-sized computer capable of simultaneously processing data for hundreds or thousands of users is most likely a ___
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!