Processing arrays of objects

Assignment Help Business Economics
Reference no: EM131587276

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.

Reference no: EM131587276

Questions Cloud

Success make it more difficult to manage stock portfolio : Why does success make it more difficult to manage a stock portfolio?
Define the economic and the global financial crisis : Ethical Perspectives on The economic and the global financial crisis paper and the process of drafting your Presentation of Research
The great western monotheisms : How do you account for the fact that he seems so much more sympathetic to those "Eastern" religions, than to the great 'Western" monotheisms?
Efficiency in an organization storage system : Evaluate the importance of measuring storage efficiency in an organization's storage system. Suggest the main approaches for measuring storage efficiently.
Processing arrays of objects : 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
What are your goals in life : What are your goals in life? Describe steps you will take to achieve your goals and ambitions. As you can see we are in the travel industry.
What is the smallest number greater than n : How many edges does a forest with n trees and v vertices (and vi vertices in the ith tree) have?
Define the instance variables of the object : Define the instance variables of the object upon its creation. By allowing for arguments - create another constructor that will only take one parameter
Annotate and evaluate their rhetorical effectiveness : Annotate and evaluate their rhetorical effectiveness and their usefulness in your essay

Reviews

Write a Review

Business Economics Questions & Answers

  What are the major institutional changes that take place

What are the major institutional changes that take place with economic development? Are these institutional changes causes or mere correlations of growth? Or is growth a cause of institutional change?

  What price would you recommend fastwash charge per load

FastWash is a new service that allows businesses, such as restaurants and hotels, to send out linens to be washed, dryed, and folded. They are new to the market and the first business of their kind to enter. After some initial research, FastWash has ..

  Daily consumption of gasoline in the us amounted

At the beginning of this year, daily consumption of gasoline in the US amounted to 344 million gallons. It is estimated that for every 10% increase in the price of gasoline, quantity demanded falls by 1.50%. By the end of this year, the price of gaso..

  What was your decision-making behavior

Consider the restaurant purchase you made in Topic 1. What was your decision-making behavior? Was it a routine, complex, or limited problem-solving situation? Identify which behavior and explain how the level of involvement played into your decision.

  Preparing them better for a global society

Identify three changes that American society is undergoing, and discuss how those changes are reflected in schools? How can you as a teacher become better prepared for the cross-cultural differences that you are certain to encounter among students? H..

  Elucidate what is the fair price of this bond

Suppose that two UK government bonds have same face values with £100. One has an outstanding maturity of 2.5 years. Its coupon rate is 9.75% and coupons are paid semi-annually.

  Thinking back to the business cycle discussion

Thinking back to the business cycle discussion, how would Keynesian economists explain the performance of the economy during the last few years? Show graphically using the AD/AS model, and explain your reasoning. Next, how would neoclassical economis..

  Elucidate how the law of diminishing returns influences

Elucidate how the law of diminishing returns influences the shapes of the variable-cost and total-cost curves.

  Explain what happens to economic growth over time.

A decrease in the investment rate: Suppose a country enacts a tax policy that discourages investment, and the policy reduces the investment rate immediately and permanently from ¯ s to ¯ s0.  Assuming the economy starts in its initial steady state, u..

  The main reason firms may exit a market

The main reason firms may exit a market is because of:

  Disagreement over the amendments

The factory operation creates smoke that affects nearby homeowners, causing respiratory ailments and similar problems.

  Suppose the monopolist only sold the goods separately

Consumer A values good 1 at $4,500 and good 2 at $1,500. Consumer B values good 1 at $5,000 and good 2 at $1,000. Costs are zero. Suppose the monopolist only sold the goods separately. What prices will the monopolist charge for good 1 to maximize rev..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd