Create a default and parameterized constructor

Assignment Help JAVA Programming
Reference no: EM131915591

Lab Assignment- 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

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.

Attachment:- Lab-Report-Template.rar

Reference no: EM131915591

Questions Cloud

Explain the recruitment and selection process : Explain and draw a chart. Explain the recruitment and selection process in the organization that you have chosen. How will HRP process assist the organization
Construct the amortization schedule for this loan : Epitome healthcare has just borrowed 1,000,000 on a five year annual payment term loan at a 15% rate. Construct the amortization schedule for this loan
Describe the type of segmentation used : Based on the ad, describe the characteristics that you feel the target group for this ad may have by using as much detail as possible.
Calculate the present value of future interest payments : Calculate (a) the present value of future interest payments, (b) the present value of the future value, and (c) the issue price of the bonds
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.
Construct a cash disbursement budget for march - may only : They pay for the rest on credit of which they pay 75% the month after it is incurred and 25% two months after. Construct a cash disbursement budget
How you are going to undertake your research : Identify and select any one research topic of your own interest. How you are going to undertake your research by using the research process
Identify the company you work for and the product : An ever-growing world population means American firms have countless opportunities to conduct business abroad, especially in developing nations.
Discuss the fragrance industry five forces analysis : Definition of the industry this section does not have to be long. it is essentially the basis for fragrance industry's five forces analysis.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Program that prompts the user to enter the year and display

Write a program that prompts the user to enter the the year and first day of the year and displays the calendar table for the year on the console. For example , if the user entered the year 2013, and 2 for tuesday, January 1, 2013, your program shoul..

  Design a dynamic programming algorithm

Design a dynamic programming algorithm to find the value of the optimal plan. Implement your algorithm using any programming language you prefer.

  When an exception occurs in an ada procedure

When an exception occurs in an Ada procedure, either in the elaboration of its declaration or execution of its body, the exception

  Write a program to implement the boyer-moore algorithm

Write a program to implement the Boyer-Moore algorithm - Design a greedy algorithm to solve the activity selection problem. Suppose there are a set of activities: a1, a2, ...an that wish to use a lecture hall. Each activity ai has a start time sia..

  Does the clean slate act apply to publications

Does the Clean Slate Act apply to publications of criminal convictions primarily overseas?

  Write a program called drawing in the form of a public class

Write a program called Drawing in the form of a public class Drawing that extends a Java JFrame and provides the following features.

  Make main method that uses the comparevalues method

Make a main method that uses the compareValues method from question 29 to determine if two integers are the same. Prompt the user for two integers

  Define the rectangle2d class

Implement a Stock class that has the following attributes: symbol (String), price (double), number of shares - Define the Rectangle2D class

  Prepare a program that utilizes your computer class

Prepare a program that utilizes your Computer class. Define a Computer class that can be used to describe your computer.

  Main method to test your class with at least three hot dog

Need a constructor that allows a user of the class to initialize both values. Also need a method named JustSold that increments the number of hot dogs the stand

  Given an array with 100,000 entries to sort

Sorting  given an array with 100,000 entries to sort. Under what circumstances would you use each of the following: insertion sort,mergesort'quicksort

  The tokens should be placed in an array of strings

Create a public class Postfix1 inside Postfix1.java and add a main method. Now write a static method to read in a line of text that is purportedly a postfix arithmetic expression from the console (without prompting), and split it into tokens eliminat..

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