Create a stock class to manage the stock activity

Assignment Help JAVA Programming
Reference no: EM131588603

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.

CODE STYLE REQUIREMENTS
- Include meaningful comments throughout your code.
- Use meaningful names for variables.
- Code must be properly indented.
- Include a comment header at beginning of each file, example below.
/****************************************************
Program Name: ProgramName.java
Programmer's Name: Student Name
Program Description: Describe here what this program will do
***********************************************************/

Reference no: EM131588603

Questions Cloud

Calculate the past growth rate in earnings : Calculate the past growth rate in earnings. What is Bouchard's cost of retained earnings, rs?
Write an algebraic expression that represents area of flag : Write an algebraic expression that represents the area of the flag. They have exactly 90 square feet of the red material.
Discuss psychosocial development : Research child-raising practices of the culture of your choice and predict their psychosocial development
What is the net cash by operating activities : S company reported net income for 2016 in the amount of $400,000. What is the net cash by operating activities under the indirect method
Create a stock class to manage the stock activity : Create a GUI that uses JList andJTabbedPanes - Process multiple objects in an ArrayList and Code event handlers for multiple events
Wacc and cost of common equity : If the firm's net income is expected to be $1.0 billion, what portion of its net income is the firm expected to pay out as dividends?
What psychological features do we expect to see in adults : Because most Americans do not practice rites of passage, how do we know when adolescence ends and adulthood begins
What is the cost of the preferred stock-including flotation : Travis Industries plans to issue perpetual preferred stock with an $11.00 dividend. What is the cost of the preferred stock, including flotation?
What developmental problems do you expect children : What developmental problems do you expect children in your Head Start program to have because of living in a lower socio-economic neighborhood

Reviews

Write a Review

JAVA Programming Questions & Answers

  Java application to generate three-digit random number

Write a Java application that generates a 3-digit random number 100 times. Display the output for each of the generated numbers and the sum of all 100 numbers.

  Program that decrypts the file produced by above program

Write another Java program that decrypts the file produced by above program. The decryption program should read the contents of the coded file, restore the data to its original state, and write it to another file.

  Size of the frame to be set a little bit larger than content

I need the size of the frame to be set a little bit larger than its content, which is a label. Also, the location could be set so that it could be appeared not at the upper left corner of the screen. And we can set the foreground and background co..

  Create a java project named assessment and a package called

Create a Java project named Assessment and a package called Assessment - Create a class called BirdArrayList with a main method

  Assume the existence of a function copyvillian

Show how you would use the above copyVillian function to create a copy of sharpay called sharpaysMoreEvilTwin.

  Write a method compact that removes all zeroes

Write a program that reads a text file (compact.txt) and stores the integers in an array.  Your instructor will provide this text file.

  Write a java program that draws a square abcd

Write a java program that draws a square ABCD. The points A and B are arbitrarily specified by the user by clicking the mouse button. The orientation of the points should be counter-clockwise

  Create a console-based application named multiplication

Create a console-based application named Multiplication whose main() method asks the user to input and then calls a method named MultiplicationTable(), which displays the results of multiplying the integers by each of the number 2 through 10

  Write a program that extends the bankaccount class

To verify the banks total, read the file and write a program using a CarLoan class that extends the BankAccount class (found on page 671 - 672 in the textbook).

  Compute the fifties and the remaining amount

Prompt the user for a string input value for the amount in dollars and store it in a variable named input and convert the string to an integer and store it in the variable named amount.

  Write a java program to prompts a user to enter information

Write a Java program prompts a user to enter demographic information

  1 write an application class that contains several

1 write an application class that contains several methods.nbspthe first method should be named greeting and should

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