Reference no: EM131214145
Lab-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 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 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.
For the circuit of given figure find vab
: For the circuit of given figure, find Vab if (a) k = 0 and (b) k = 0.01. - Do not use network theorems to simplify the circuit prior to solution.
|
Difference in antisocial and borderline personality disorder
: Discuss the similarities and differences between antisocial personality disorder and borderline personality disorder. What are the practice implications of these two disorders for forensic mental health professionals? Why do you think that substan..
|
What assumption is the prosecutor making
: The prosecutor concludes that the probability that a student is wearing both Duke sweatpants and a UNC sweatshirt is 2% (0.1*0.2 = 0.02), which is large enough to cause reasonable doubt for the jury, so they don't convict him. What assumption is t..
|
What is the probability that the student
: Suppose that a certain college class contains 40 students. Of these 26 are juniors, 27 are history majors, and 10 are neither. A student is selected at random from the class. (a) What is the probability that the student is both a junior and a histo..
|
Create a stock class to manage the stock activity
: Create a Stock class to manage the stock activity. It should have private instance variables of company name. Create a get method to calculate and return the profit or loss. This would be calculated as Number of shares * (current price - purchase pri..
|
What strategies would you recommend to mitigate
: What strategies would you recommend to mitigate the negative aspects of aging? What have you learned from this assignment and the text about the positive aspects of aging?
|
Determining the human population
: According to the American Red Cross, approximately 10% of the human population is blood type B-positive. If we select 20 people at random, find the probability that more than 3 people in the sample have blood type B-positive. Is this unusual?
|
How to minimize these threats
: Consider the Stay Home Online Rentals case study discussed in Chapter 5. Produce a report for the Director of the company outlining the threats that may exist for its database system, and provide a set of recommendations on how to minimize these t..
|
What height represents the first quartile
: In a survey of men in a certain country (ages 20-29), the mean height was 66.5 inches with a standard deviation of 2.9 inches. a) What height represents the 80th percentile? b) What height represents the first quartile?
|