Chat with us, powered by LiveChat Module 4 - Lab: Processing Array of Objects ?In this lab, you will create a GUI application using an array of objects. View the lab instructions and video provided below to help guide | Wridemy

Module 4 – Lab: Processing Array of Objects ?In this lab, you will create a GUI application using an array of objects. View the lab instructions and video provided below to help guide

 

 In this lab, you will create a GUI application using an array of objects. View the lab instructions and video provided below to help guide you through your efforts. 

CIS355A Week 4 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 using JTabbedPane.

· One tab (Show stocks) should have the following.

· A JList to display all the stock purchases

· A text field or label to display information about a stock

· 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 and gets for all instance variables.

Create a get method to calculate and return the profit or loss. This would be calculated as follows.

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.

Sample GUI

Grading Rubric

Stock class

· It has all required functionality.

10

GUI class

· Use the Stock class to process data.

· 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.

· Use error messages for any invalid or missing user input using JOptionPane.

25

Code style

5

Total

40

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  ***********************************************************/

Deliverables

Submit the following as a single zip folder.

· All Java files

Follow the assignment specification regarding class and method names.

Note that your Java file name must match class name (do not rename).

CIS355A Week 4 Lab Instructions Page 3

image1.png

image2.png

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

About Wridemy

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.

Hire a tutor today CLICK HERE to make your first order

Related Tags

Academic APA Writing College Course Discussion Management English Finance General Graduate History Information Justify Literature MLA