Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem Description: A person purchased numberShares shares of Buffalo Wild Wings (BWLD) stock at the price of buyPrice per share and paid the stockbroker $15

Problem Description: A person purchased numberShares shares of Buffalo Wild Wings (BWLD) stock at the price of buyPrice per share and paid the stockbroker $15 transaction fee. Two months later, the person sold the numberShares shares at sellPrice per share and paid another $15 for the transaction. Write a Java program to calculate and display the following: 1. The dollar amount paid for the shares 2. The dollar amount of the shares sold 3. The total transaction fee paid to the broker (including both buy and sale) 4. The amount of profit (or loss) made after selling the shares. The values of numberShares, buyPrice, sellPrice are input from the user. For example, if the interactive execution looks like this (user's inputs are shown in bold): How many shares bought? 150 Buy price? 44.83 Sell price? 46.54 The output generated by your program should like this: Here is the information of your stock transactions Number of shares: 150 Amount of purchase: $6724.50 Amount of sell: $6981.00 Transaction fee paid: $30.00 Net profit: $226.50 Do not worry if you show more or fewer decimal places with the results.

Template: You may use the following block of code as a starting point.

image text in transcribed

YOUR HEADER HERE public class TransactionCalculator t public static void main (String[] args) final double TRANSACTION FEE 15.0 int number Shares 0; double buy Price 0; double sell Price 0; double net Profit E 0; Step 1 Prompt user for number of shares, buy and sell price. Read in and save provided value YOUR CODE HERE Hint: use nextInt and nextDouble() as appropriate*/ Step 2 Calculate net profit net Profit numbers hares buy Price numbers hares sellPrice 2 TRANSACTION FEE Step 3: Display information about transaction YOUR CODE HERE

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Systems For Physicians And Medical Professionals How To Use And Access Databases

Authors: Harley Bjelland

1st Edition

1878487442, 9781878487445

More Books

Students also viewed these Databases questions

Question

what are the provisions in the absence of Partnership Deed?

Answered: 1 week ago

Question

1. What is called precipitation?

Answered: 1 week ago

Question

1.what is dew ?

Answered: 1 week ago

Question

1.The difference between climate and weather?

Answered: 1 week ago