Question
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.
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 HEREStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started