Create a stockio class that is used to read from a text file

Assignment Help Computer Engineering
Reference no: EM131516395

Lab- File Processing

OBJECTIVES

• Add persistent data storage to your Lab using text file input/output.

PROBLEM: Stocks4U Portfolio Management System

The portfolio management system you developed for Stocks4U needs the ability to save and restore a user's data from a text file.

FUNCTIONAL REQUIREMENTS

You can code the GUI by hand or use NetBeans GUI Builder Interface.
You will enhance Week 4 GUI to include

• a File menu with menu items: open, save, exit; and
• a label to display total portfolio value.

Stock class

• Modify the toString of Stock class to display as

"Company: qty shares" (i.e., "Apple: 10 shares")

StockIO class

Create a StockIO class that is used to read from and write to a text file using an ArrayList. Make sure to use a delimiter between the fields; it does not have to be the # character. Example format of the file is:

Apple#100#55.0#80.0
Intel#50#75.0#70.0

This class should have two methods.

• getData-reads data from file, returns data in array list of stock objects
• saveData-writes data from an array list to the file in proper format

The file name will be an instance variable that you can set with a parameterized constructor, or with a separate method.

GUI class

Note that you will need to add an ArrayList to your GUI class to manage the data to/from the file. It will act as a parallel array to your DefaultListModel. Anytime you add a stock, you must add it in BOTH places. Anytime you remove a stock, you must remove it in BOTH places.

File-open should prompt for filename using JOptionPane, read the file and populate the JList.
File-save should prompt for filename to save data from JList to.
File-exit should exit the program.

The total value of the portfolio should be displayed at all times and updated anytime a stock is added or removed.

Attachment:- Lab_Instructions.rar

Reference no: EM131516395

Questions Cloud

How will your plans affect the business : How will they affect balance between securing systems and allowing business enough breathing room to function effectively? How will your plans affect business?
Discuss the changing purposes and needs for labor unions : Discuss the changing purposes and needs for labor unions in the light of federal and state legislation protecting non-union and union workers.
Define the ethical dilemma : A newspaper columnist signs a contract with a newspaper chain. Several months later she is offered a position with another newspaper chain at a higher salary.
Develop a fictional organizational communication case : CMN 251:Create and analyze an original case.Develop a fictional organizational communication case that lends itself to analysis.
Create a stockio class that is used to read from a text file : Create a StockIO class that is used to read from and write to a text file using an ArrayList. Make sure to use a delimiter between the fields.
What is the myth : Discuss your favorite myth. What is it? Describe it. What purpose does this myth hold? Also, discuss if this myth or other myths can be harmful in anyway.
Define the types of valves : An automatic sprinkler system will employ many different valves in its operation. The two main types of valves are control valves and operating valves.
Discuss the relationship between these three concepts : High performance working (HPW) depends on high commitment and high involvement. Discuss the relationship between these three concepts.
Design a functional coffee shop similar layout to starbucks : Project Description: My homework assignment is to design a functional coffee shop, similar layout to Starbucks, in CAD from provided CAD file.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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