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
Only Lysita knows the password for the question......
emmasim [6.3K]
The correct answer is 1234.

7 0
3 years ago
If there is no index.html file in the root folder nothing will be displayed when you navigate to the site address
MAVERICK [17]
This can be a tricky question because this could be true or false depending how the Web Server is setup. For instance, with the Apache web server you do not need an index.html file as long as you have a index.htm file or an index.php file. So the answer could be false if you have one of the other files. Anyways, I think they mean an index file in general so the answer is true.
7 0
3 years ago
Define a function UpdateTimeWindow() with parameters timeStart, timeEnd, and offsetAmount. Each parameter is of type int. The fu
Evgesh-ka [11]

Answer:

C code is given below

Explanation:

// Define a function UpdateTimeWindow() with parameters timeStart, timeEnd, and offSetAmount. Each parameter is of type int. The function adds offSetAmount to each of the first two parameters. Make the first two parameters pass-by-pointer. Sample output for the given program:

#include <stdio.h>

// Define void UpdateTimeWindow(...)

void UpdateTimeWindow(int*timeStart, int* timeEnd, int offSetAmount){

*timeStart = *timeStart+ offSetAmount;

*timeEnd = *timeEnd+ offSetAmount;

}

int main(void) {

  int timeStart = 0;

  int timeEnd = 0;

  int offsetAmount = 0;

  timeStart = 3;

  timeEnd = 7;

  offsetAmount = 2;

  printf("timeStart = %d, timeEnd = %d\n", timeStart, timeEnd);

  UpdateTimeWindow(&timeStart, &timeEnd, offsetAmount);

  printf("timeStart = %d, timeEnd = %d\n", timeStart, timeEnd);

  return 0;

}

5 0
3 years ago
15 points. Please give an actual answer and not some random thing. this is not just free points. Correct answer will receive bra
trapecia [35]

Answer:

i think its b

Explanation:

i did the test and got it right

7 0
3 years ago
Read 2 more answers
What is the capture of transaction and event information using technology to (1) process the information according to defined bu
Tanya [424]

Answer:

OLTP(Online transaction processing)  is the correct answer.

Explanation:

It is the database application that is used to catching the transection and that data or information which is related to the technology for the purpose of.

  • Process that data and information which is related to the following rules of the business or company.
  • It stores the data or information related to the online transaction.
  • It also helps to modify the current data or information for the new data or information.
6 0
3 years ago
Other questions:
  • Sarah's research shows that business information management professionals also perform the duties of other professionals. Which
    9·1 answer
  • Melissa and Sue want to show a presentation to twenty employees using a presentation while using a projector. They learn that th
    12·2 answers
  • Write a program that asks the user to enter two dates (in YYYY-MM-DD format), and then prints which date is earlier. Your progra
    15·1 answer
  • Given that a function receives three parameters a, b, c, of type double, write some code, to be included as part of the function
    9·1 answer
  • Which wireless communication is typically limited to six feet of distance?
    6·1 answer
  • What would be an ideal scenario for using edge computing solutions?
    10·1 answer
  • You have to cut a wood stick into pieces. The most affordable company, The Analog Cutting Machinery, Inc. (ACM), charges money a
    10·1 answer
  • In one to two sentences, describe how you would add a new slide to your presentation.
    11·2 answers
  • Discuss five processes for analyzing a qualitative study
    11·2 answers
  • AfcAAgrwdsgsFsefvzsdfvbjhbdjbbjbjsdndVHFadbhZJBVdb
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!