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

  How long will it take to reach steady-state value

Investigate the effect of the parameter b on y(t). To do this, plot y versus t for several values of b on the same plot. How long will it take for y(t) to reach 98 percent of its steady-state value?

  Segmented-demand paging memory allocation

Describe how the function of the Page Map Table (PMT) differs in paged vs. segmented/demandpaging memory allocation.

  Which sql statement is used to insert new data in a database

Which SQL statement is used to insert new data in a database?

  Develop a class for feasible-flow problems

Develop a class for feasible-flow problems that includes methods allowing clients to set supply-demand values and to check that flow values are properly related at each vertex.

  Multidimensional databases different from relational

1. How are a data warehouse and a data mart related? 2. Why must data be "transformed" by the ETL process before loading them in the data warehouse? 3. How are multidimensional databases different from relational databases?

  Emulate a target add instruction and a target jump-on-zero

Also sketch the particular host instructions needed to emulate a target add instruction and a target jump-on-zero instruction.

  Parallel processing effectiveness

Parallel processing effectiveness Consider two versions of the task graph in Fig. Version U corresponds to each node requiring unit computation time. Version E/O corresponds to each odd-numbered node being unit-time and each even-numbered node tak..

  Document the requirements for the calcpay application

Define and document the requirements for the calcPay application. Describe the stakeholders needed to help further define the application. Describe a collaboration plan for working with stakeholders.

  External share between the two domains

You have two domains (contoso.com and adatum.com) that have an external share between the two domains. You want to configure selective authentication. What should you do.

  Compare and contrast announced penetration testing

Compare and contrast announced penetration testing and unannounced penetration testing. Speculate on whether or not there are instances where unannounced testing is preferred over announced testing. Justify your resp

  What are two possible ways to achieve this goal

You need to relocate the existing user and computer objects in your company to different organizational units. What are two possible ways to achieve this goal? (Note: not the two "options" in the book.)

  Determine the winner of the got talent contest

Write a C++ program to determine the winner of the Got Talent contest. The contest has five judges, each of whom awards a score between 1 and 10 for each of the performers. Fractional scores are not allowed. A contestant's final score is determined b..

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