Display the amount of profit and loss

Assignment Help Basic Computer Science
Reference no: EM131241721

Stock Profit

The profit from the sale of a stock can be calculated as follows:

1537_e2818fd4-5d11-4c24-8655-33e0f6f235c1.png

where NS is the number of shares, SP is the sale price per share, SC is the sale commission paid, PP is the purchase price per share, and PC is the purchase commission paid. If the calculation yields a positive value, then the sale of the stock resulted in a profit. If the calculation yields a negative number, then the sale resulted in a loss. Write a function that accepts as arguments the number of shares, the purchase price per share, the purchase commission paid, the sale price per share, and the sale commission paid. The function should return the profit (or loss) from the sale of stock.

Demonstrate the function in a program that asks the user to enter the necessary data and displays the amount of the profit or loss.

 

Reference no: EM131241721

Questions Cloud

Write article about homelessness and poverty in community : Write an article about homelessness and poverty in your community, and how organizations (i.e. Salvation Army, Red Cross, churches, etc.) are helping. Write the article with the intention of publishing it in the community newspaper. How is your commu..
What was the initial speed of the lighter car : What was the initial speed of the lighter car (in km/h)? What was the initial direction (as measured counterclockwise from the x-axis)?
Draw the free-body diagram : We want to lower crate m1 down the ramp shown below with an acceleration of 1.25m/s².There is no friction on the ramp, but the level side has a coefficient of friction of 0.30. a. Draw the free-body diagram for each of the crates shown.
How the demand for accountants affects earning potential : Explain how the demand for accountants and CPAs affects earning potential in the accounting profession. What certifications interest you and how do they relate to your career goals?
Display the amount of profit and loss : Demonstrate the function in a program that asks the user to enter the necessary data and displays the amount of the profit or loss.
Construction of the data dictionary : A first systematic step to a data science process, as we have learned from the lectures and practical sessions, is to construct a data dictionary for the dataset.
What level of employees to focus on and why : Discuss Manuele's approach to Human Error Reduction including 1) What level of employees to focus on and Why, 2) and briefly explain the concepts of A) Latent Conditions, B) The Concept of Drift, and C) Manuele's view of Worker Focused Behavior-Ba..
Sketch the graph of the equation fromt : Sketch the graph of the equation fromt = 0 to t = 18. How much is in the account on your 18thbirthday? Answer in units of dollars.
Derive and compute steady-state value of output per worker : Indonesia’s production function is Y = AKαL1-α. Assume that A (technology) = 1 and α = .33. Additionally, Indonesia’s investment/savings rate is 10%. Indonesia has 50 units of capital per worker and a constant depreciation rate of 3%. Assume that Ind..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd