Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

***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.40

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

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions

Question

What are the structures and functions of the limbic systempg12

Answered: 1 week ago