Create stockio class that is used to read from and write to

Assignment Help Operating System
Reference no: EM131222087

Lab-File Processing

OBJECTIVES

• Add persistent data storage to your Week 4 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 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.

Reference no: EM131222087

Questions Cloud

Design a data warehouse for a regional weather bureau : All data are sent to the central station, which has collected such data for more than 10 years. Your design should facilitate efficient querying and online analytical processing, and derive general weather patterns in multidimensional space.
Presented is situation involving equity securities : Presented below is a situation involving equity securities: What is the effect upon carrying value and earnings for the scenario presented?
Processes of collectivization and industrialization : What were the processes of collectivization and industrialization in the USSR? What were Stalin's goals with each of these campaigns? Were the methods Stalin used to collectivize and industrialize successful or not?
Create a wbs for the scope of the project : Analyze the various activities required for this project and provide an estimate of duration for each activity based on the number of resources available for the project. Include assumptions and basis for each estimate.
Create stockio class that is used to read from and write to : 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.
How to retrieve data from your structures : A popular data warehouse implementation is to construct a multidimensional database, known as a data cube. Unfortunately, this may often generate a huge, yet very sparse, multidimensional matrix.
New server deployments you have planned : You have recently hired a server administrator who will help with some new server deployments you have planned. This administrator has worked in environments with only a few servers and computers and has never deployed OSs on a large scale before.
Repaid the note payable to supplier with interest : Moulton Corporation opened for business on January 1, Year 13. It uses the accrual basis of accounting. Acquired equipment on December 31 costing $80,000 and signed a 6% note payable to the supplier. The note is due on June 30, Year 13. The equipment..
Advise management on the different contract types available : OPERATIONS AND INNOVATIONS MANAGEMENT ASSIGNMENT. Advise management on the different contract types available, based on the closeness of the relationship with the suppliers

Reviews

Write a Review

Operating System Questions & Answers

  Implementation of algorithms for process management

The Shortest Job Next (SJN) algorithm queues processes in a way that the ones that use the shortest CPU cycle will be selected for running rst.

  Develop a user mode command interpreter

Develop a user mode command interpreter which support list-short.

  Memory allocation in operating system

Analysis and implementation of algorithms for memory allocation in operating system, Explain First- t and best- t methods are used in memory allocation in operating systems.

  Stand alone child process

Forking the child process

  Write a multi-threaded program

Write a multi-threaded program to solve producer and consumer problem

  Marginal and average cost curves

n a competitive market place (pure competition) is it possible to continually sell your product at a price above the average cost of production.

  Simulating operating systems scheduling

Simulate the long-term scheduler, the short-term scheduler and the I/O scheduler of the computer using the First-Come-First-Serve algorithm.

  Issues with trusted platform module

Research paper discussing the issues with Trusted Platform Module (TPM)

  Threads

Explain a complication that concurrent processing adds to an operating system.

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  Virtual machines

Virtual machines supported by a host operating system

  Discuss an application that benefits barrier synchronization

Discuss an application that would benefit from the use of barrier synchronization

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