Create a default and parameterized constructor

Assignment Help Data Structure & Algorithms
Reference no: EM131290757

Lab-Processing Arrays of Objects

OBJECTIVES

• Create a GUI that uses JList andJTabbedPanes.
• 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 usingJTabbedPane.

• One tab ("Show stocks") should have

o a JList to display all the stock purchases;
o a text field or label to display information about a particular stock; and
o aJButton 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: EM131290757

Questions Cloud

The appraisal feedback process : Your supervisor, Annalise, the Human Resources Director at Matrix, has reviewed your research on performance appraisal feedback and is very impressed with your work.
Marketing research and the promotion of customer loyalty : Marketing research is a valuable resource that guides organizations' decision making. As noted in the Learning Resources, research is used to help organizations identify consumers' needs and concerns and then develop marketing strategies to addres..
Major organized crime groups of different nationalities : Identify three of the major organized crime groups of different nationalities that currently operate in the U.S. and discuss the type of crime in which they tend to be most involved.
Calculate the income elasticity of demand : Calculate the income elasticity of demand ηI. Are vegetables inferior goods and calculate the optimal prices in each market - What would be the profit of the XOCOLAT FACTORY if it decided to engage in price discrimination?
Create a default and parameterized constructor : 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).
Characteristics of a successful manager detail : A personal experience you had with a manager that exemplified or struggle with one of the characteristics of a successful manager detail by your peers.
Create a presentation that discuss the business idea : Create a PowerPoint presentation to include the following information: Title slide to include the name of the business and your name. One or two slides to discuss the business idea.
Determine the value of the portfolio : Determine the value of the portfolio if the domestic stock increases by 2 percent, the domestic stock futures contract increases by 1.8 percent, the foreign stock increases by 1.2 percent, and the foreign stock futures contract increases by 1.4 pe..
Determine the overall profit from the transaction : Determine the overall profit from the transaction. Then break down the profit into the amount earned solely from the performance of the stock, the loss or gain from the currency change while holding the stock, and the loss or gain on the futures t..

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Evaluate a virtual memory system

The objective of this lab is to simulate and evaluate a virtual memory system, and experiment with different page replacement algorithms. You will need a threads package, e.g., pThreads thread package

  Determine the impedances of elements in laplace domain

Redraw the schematics with the impedance of each of the element shown in Laplace domain. Then determine the overall impedance of the entire circuit between the two ends of the shown circuit and express it in Laplace domain as a ratio of two polyno..

  Modify the infix evaluation program

Modify the infix evaluation program

  Write a program that processes a threaded binary tree

Write a program that processes a threaded binary tree. The program should first build the tree, then use an iterative traversal to process it using the threads.

  Design an algorithm that asks for the user for the number

Design an algorithm that asks for the user for the number of fixed-price items to order, adds sales tax and flat-rate shipping, and displays the result.

  Use sequential search algortithm to locate the number

These numbers should be stored in an array. Use the sequential search algortithm to locate the number entered by the user. If the number is in the array, the program should display a message.

  Whats the difference between a project risk and an issue

What would be your response if a team member came to you with one or more of the following questions - Why do we have to do all of this project documentation ahead of the real work?

  Determine if a string s is a palindrome

What data structure is most suitable to determine if a string s is a palindrome, that is, it is equal to its reverse.

  Find the sum of the degrees of the vertices

Find the sum of the degrees of the vertices

  Provide definitions of all terms acronyms and abbreviations

Provide a description and scope of the software and explain the goals, objectives and benefitsof your project. This will provide the basis for the brief description of your product.

  Organize and manage the genealogical tree

Suppose you are asked to develop a program that creates and develops thepedigree of a family. Asked to define the main structures (structures or classes) thatwill organize and manage the genealogical tree so that the program be able to answer at leas..

  By what amount have we increased the likelihood

If we define a "good" split to mean choosing the pivot as x = A"[i], where n/ ≤ i ≤ 2n/3, by what amount have we increased the likelihood of getting a good split compared to the ordinary implementation?

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