Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please I need your help:Using Java write a GUI program that maintains a cash balance, list of stock holdings, supports buying and selling of stocks

Please I need your help:Using Java

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedwrite a GUI program that maintains a cash balance, list of stock holdings, supports buying and selling of stocks and displays the current portfolio inventory demonstrate the ability to assemble already-written classes into a larger, more complicated program demonstrate the ability to segregate business logic from user interface code. Capabilities At a minimum, the program should allow a user to buy a stock with a given number of shares and price per share. display the current portfolio (stock ticker, number of shares, initial price). update the portfolio display for purchases and sales. allow the user to sell all of the shares of a given stock. give the user an initial cash balance, and update and display the balance according to the user's purchases and sales. ignore any transaction that causes the cash position to go below $0. Sample Execution The initial frame has text fields for the stock ticker, number of shares, and price per share. It has a label for the current cash balance. It also has buy and sell buttons. Stoc Shares per Share Cash: 1000.0 Sell Buy Let's buy Apple (ticker AAPL) shares. First we enter the ticker, number of shares and price per share. Then we click Buy. Note our cash was reduced accordingly. Our portfolio inventory now displays since it's no longer empty. Let's buy IBM. We enter the ticker, number of shares and price per share We click Buy. Our cash is reduced appropriately, our portfolio is updated. WidgetView moves things around. We won't worry about that. We also won't worry about the not-quite-right truncation of the last penny of the cash balance. Let's buy Microsoft (MSFT). We'll just skip to the completed transaction. We're losing faith in IBM's CEO; let's sell it. We need to tell our portfolio manager which stock we want to sell, and the selling price per share. Since we're selling all of our shares, we don't need to fill in that field. We click Sell, and the portfolio listing and cash are updated

Stoc Shares per Share Cash: 1000.0 Sell Buy

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_2

Step: 3

blur-text-image_3

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

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

More Books

Students also viewed these Databases questions