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

  Higher interest rate increases consumption

Show, using the concepts of income and substitution effects, that higher interest rate increases consumption in year 2 but may either increase or reduce the amount saved in year 1. (Hint: increase the interest rate to change the budget lines.) Gr..

  Internet, internet, intranet

Define the terms internet, Internet, intranet and extranet, highlighting the similarities and differences between them.

  Compare and contrast strayer university''

Compare and contrast Strayer University's identity management system (which students are required to use to access their classes, grades, course schedules, registration, etc.) to the Oracle Identity Manager 11g. Determine which one you prefer and exp..

  Delegation and work allocation

Your manager has come to you to ask for assistance. Productivity levels of the team you supervise have been consistently dropping over the last three or four weeks. Your manager asks you to find out what the problem/s is/ are and to make suggestio..

  Company culture and behavior change

Company culture and behavior change

  Which of the following is wrong

Which of the following is wrong? A. LDX #$5000 B. LDX #2550 C. LDX #$10000 D. LDX #$00 Explain Why!

  Two complement representation

How many unique integer values can be represented in an 8-bit two's complement representation?

  Determine the appropriate footing size type and layout

The allowable soil pressure is 4000 psf. Determine the appropriate footing(s) size, type, and layout. Assume thickness and disregard reinforcing.

  Which of these options is required or permissible

Fourth, what are the options you see available for solving the dilemma? Fifth, which of these options is required (obligatory, all things considered) or permissible (all right)?

  Compute the annual depreciation allowances

Consider the following date on an asset: Cost of the asset, I: $150,000, Useful life, N: 5 years and Salvage value, S: $16,000. Compute the annual depreciation allowances

  Microsoft dynamics introduction

Topics: navigation, role center, productivity enhancement, decision support, workflow, industries supported, etc. Please write 1 FULL page report on what you have learned from this video (double space, font size 12) When watching videos, please ta..

  The menu structure for holiday travel vehicle"s existing

The menu structure for Holiday Travel Vehicle's existing character-based system is shown here. Develop and prototype a new interface design for the system's functions, using a graphical user interface.

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