Answered step by step
Verified Expert Solution
Question
1 Approved Answer
java program: Write a program that calculates the user's profit or loss with a mutual fund transaction. Have the user enter these pieces of data:
java program: Write a program that calculates the user's profit or loss with a mutual fund transaction.
Have the user enter these pieces of data:
- (int) Number of shares purchased
- (double) Purchase price per share
- (double) Selling price per share
- (double) Commission percentage
Then output this data and calculate/output:
- Purchase commission
- Total purchase cost (price for shares plus commission)
- Selling commission
- Total selling proceeds (selling total minus commission)
Format your output like this shown below (or improve on it). Don't worry if your numbers print more decimal places.
EXTRA CREDIT: Read ahead on output formatting in Section 3.10 of the textbook, and for an extra 10 points, use formatting specifiers to match the output below.
***Mutual Fund Profits*** This program will calculate your profit/loss on mutual funds transactions Enter the number of shares purchased: 5000 Enter the purchase price per share: 19.86 Enter the selling price per share: 21.02 Enter the commission percentage in decimal form, eg. 2.5% enter "2.5": 3.1 Calculations: Commission rate: 3 , 10% Number of shares: 5000 Purchase price: $19.86 Purchase commission: $0.62 Total purchase cost: $102,378.30 Selling price: $21.02 Selling commission: $0.65 Total selling proceeds: $101,841.90 Net profit0ss: $-536.40Step 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