Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program to accept inputs from a user including yourName, numbershares shares (only whole shares allowed) purchased of some stock (for example the Microsoft

image text in transcribed

Write a program to accept inputs from a user including yourName, numbershares shares (only whole shares allowed) purchased of some stock (for example the Microsoft stock symbol is MSFT) at the price of buyPrice per share and paid the stockbroker $15 buyTransactionFee. Two weeks later, the person sold the numberShares shares at sellPrice per share and paid another $10 for the sellTransactionFee. Create the necessary input, process and output variables, choosing appropriate data types, and write a Java program to accept input, calculate and display the following: 1. dollar amount paid for the shares 2. dollar amount of the shares sold 3. total transaction fee paid to the broker (including both buy and sell) - Use constants/final 4. amount of profit (or loss) made after selling the shares

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

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions

Question

Understand why empowerment is so important in many frontline jobs.

Answered: 1 week ago