Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Business Economics Expert

Java

Processing Arrays of Objects

OBJECTIVES

  • Create a GUI that uses JList and JTabbedPanes.
  • Process multiple objects in an ArrayList.
  • Code event handlers for multiple events.

PROBLEM: Stocks4U Portfolio Management System

Stocks4U needs to develop an app for you to manage your stock purchases. You should be able to store a list of stock purchases, view the individual stocks, add and remove stocks.

FUNCTIONAL REQUIREMENTS

You can code the GUI by hand or use NetBeans GUI builder interface.

The GUI should have two tabs using JTabbedPane.

  • One tab ("Show stocks") should have
    • a JList to display all the stock purchases;
    • a text field or label to display information about a particular stock; and
    • a JButton to remove a stock.
  • One tab ("Add stock") should have textboxes, labels, and a button to input a stock.

Create a Stock class to manage the stock activity. It should have private instance variables of

  • company name;
  • number of shares;
  • purchase price; and
  • current price.

Create a default and parameterized constructor.

Create sets/gets for all instance variables.

Create a get method to calculate and return the profit or loss. This would be calculated as

Number of shares * (current price - purchase price).

Create toString to display the name of the stock.

As you add stocks, they are displayed in the JList.

If you select an element in the JList, the gain or loss is displayed in the label or text field.

If you select an element in the JList and click Remove, the stock is removed from the list.

Business Economics, Economics

  • Category:- Business Economics
  • Reference No.:- M92395990
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Business Economics

Understanding the importance of international trade in

Understanding the Importance of International Trade in Various Countries Whereas imports and exports in the United States each account for about one-eighth of total annual national income, in some countries the figure is ...

For the pastnbsp110nbspyears a certain state

For the past 110 ?years, a certain state suffered 28 direct hits from major? (category 3 to? 5) hurricanes. Assume that this was typical and the number of hits per year follows a Poisson distribution. Complete parts? (a) ...

Economics - unemploymentwhat kind of monetary and fiscal

Economics - Unemployment What kind of monetary and fiscal policies could be introduced to reduce unemployment? Why would we expect these policies to have inflationary consequences? Illustrate your answer diagrammatically

1 government spending fluctuates less than spending by

1. Government spending fluctuates less than spending by households and spending by firms on investment. Explain. 2. In countries with well-developed tax collection and welfare systems, there are automatic stabilisers tha ...

Consider the binomial distribution where n 11 and p 005

Consider the binomial distribution where n = 11 and p = 0.05. Find the mean and standard deviation of this binomial distribution. The customers at a local appliance store are polled as they leave the store. Each is asked ...

Carefully explain how the negative price elasticity of

Carefully explain how the negative price elasticity of demand affect the revenue or profit of an organization?

Discuss three ranges of the aggregate supply curve explain

Discuss three ranges of the aggregate supply curve. Explain changes in the AD-AS macroeconomic equilibrium due to the aggregate demand shifts and due to aggregate supply shifts. Apply the AD-AS model to the two types of ...

A professional baseball pitcher takes 1566 seconds to throw

A professional baseball pitcher takes 15.66 seconds to throw each? pitch, on average. Assume the? pitcher's times per pitch follow the normal probability distribution with a standard deviation of 2.6 seconds. Complete pa ...

What is the factors that determine wages which are largely

What is the factors that determine wages which are largely responsible for determining how the economy's total income is distributed among the various members of society?

At a college 66 of courses have final exams and 56nbsp of

At a college, 66 % of courses have final exams and 56 % of courses require research papers. Suppose that 45 % of courses have a research paper and a final exam.  Find the probability that a course has NONE of these two r ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As