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

  Considered to be an improved version

Part (c) is considered to be an improved version of Part (b). You may use an array (2-dimessional) to store some values that has been computed during the run so that when making recursive calls the program does not compute certain values over and ..

  Run both c++ and java versions of your program

In C++, create an Exception class, and a DivideByZero sub-class that takes a string for its constructor, and use this in the try-catch mechanism. In Java, use the division by zero exception object.

  Tapping application payment system

Tapping Application Payment System - which is a device-to-device tap technology that takes the card payment machine out from the system is proposed

  Evaluate an infix expression entered by the user

Spaces between tokens are allowed but not required. The program will repeatedly prompt the user for the value of x, displaying the value of the expression each time. When the user enters the letter q instead of a number, the program terminates.

  Concepts of polymorphism

This lab introduces students to the concepts of polymorphism, early binding, late binding, abstract classes, and virtual class functions. This will be done in the context of performing calculations on basic geometrical shapes

  Creates a file called "grades.txt" with 1000 lines

Write a program that creates a file called "grades.txt" with 1000 lines. Each line in the "grades.txt" file will consist of a student's first name, last name, graduating year(2013,2014,2015), and grade. the student's first name and last name for t..

  Create floating point arrays

Create floating point arrays each with three elements - Ask the user to give input for the two arrays.

  What is the characteristic behavior of a stack

What is the characteristic behavior of a stack? What is the characteristic behavior of a queue? What are the advantages of the java.util.Stack implementation of a stack?

  Write a program that asks for purchase price

Write a program that asks for purchase price and to calculate, state sales tax, county sales tax and then display purchase price, both sales tax amount and then the total.

  Create a package called people

Create a second package called ‘task01'. Within this package provide classes which perform the following tasks.

  Design a class checkoutsystem

Design a class CheckoutSystem. Each checkout system has a method checkout that accepts the order and a credit cart as arguments and checkouts the items.

  Output the unsorted array using declare for loop

Did you change the values from doubles to ints? Make them unsorted. output the unsorted array using //Declare For Loop 1

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