StockList Class • This class will contain the methods necessary to display various information about the stock data. • This class shall be a subclass of ArrayList. • This class shall not contain any data fields. (You don't need them for this class if done correctly). . This class shall have a default constructor with no parameters. o No other constructors are allowed. • This class shall have the following public, non-static, methods: • printAllStocks: This method shall take no parameters and return nothing. ▪ This method should print each stock in the StockList to an output file. ▪ NOTE: This method shall NOT print the data to the console. ▪ The output file shall be called all_stock_data.txt. The data should be printed in a nice and easy to read format. o displayFirstTenStocks: ▪ This method shall take no parameters and return nothing. . This method should display only the first 10 stocks in the StockList in a nice and easy to read ▪ This method should display the data in the console. o displayLastTenStocks: This method shall take no parameters and return nothing. ▪ This method should display only the last 10 stocks in the StockList in a nice and easy to read . This method should display the data in the console. computeAverageOpeningPrice: ▪ This method shall take no parameters and return a double value. This method should compute and return the average opening price of all stock data in the Sto o computeAverageClosing Price: ▪ This method shall take no parameters and return a double value. This method should compute and return the average opening price of all stock data in the Sto o findMaxHighPrice: ▪ This method shall take no parameters and return a single TeslaStock object. . This method should compute and return the maximum high price of all the stock data.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
StockList Class
• This class will contain the methods necessary to display various information about the stock data.
• This class shall be a subclass of ArrayList<TeslaStock>.
• This class shall not contain any data fields. (You don't need them for this class if done correctly).
• This class shall have a default constructor with no parameters.
o No other constructors are allowed.
• This class shall have the following public, non-static, methods:
• printAllStocks:
This method shall take no parameters and return nothing.
▪ This method should print each stock in the StockList to an output file.
▪ NOTE: This method shall NOT print the data to the console.
The output file shall be called all_stock_data.txt.
The data should be printed in a nice and easy to read format.
o displayFirstTenStocks:
This method shall take no parameters and return nothing.
▪ This method should display only the first 10 stocks in the StockList in a nice and easy to read format.
▪ This method should display the data in the console.
o displayLastTenStocks:
I
I
This method shall take no parameters and return nothing.
▪ This method should display only the last 10 stocks in the StockList in a nice and easy to read format.
This method should display the data in the console.
■
• computeAverageOpeningPrice:
This method shall take no parameters and return a double value.
. This method should compute and return the average opening price of all stock data in the StockList.
• computeAverageClosingPrice:
This method shall take no parameters and return a double value.
This method should compute and return the average opening price of all stock data in the StockList.
o findMaxHigh Price:
This method shall take no parameters and return a single TeslaStock object.
▪ This method should compute and return the maximum high price of all the stock data.
■
■
Transcribed Image Text:StockList Class • This class will contain the methods necessary to display various information about the stock data. • This class shall be a subclass of ArrayList<TeslaStock>. • This class shall not contain any data fields. (You don't need them for this class if done correctly). • This class shall have a default constructor with no parameters. o No other constructors are allowed. • This class shall have the following public, non-static, methods: • printAllStocks: This method shall take no parameters and return nothing. ▪ This method should print each stock in the StockList to an output file. ▪ NOTE: This method shall NOT print the data to the console. The output file shall be called all_stock_data.txt. The data should be printed in a nice and easy to read format. o displayFirstTenStocks: This method shall take no parameters and return nothing. ▪ This method should display only the first 10 stocks in the StockList in a nice and easy to read format. ▪ This method should display the data in the console. o displayLastTenStocks: I I This method shall take no parameters and return nothing. ▪ This method should display only the last 10 stocks in the StockList in a nice and easy to read format. This method should display the data in the console. ■ • computeAverageOpeningPrice: This method shall take no parameters and return a double value. . This method should compute and return the average opening price of all stock data in the StockList. • computeAverageClosingPrice: This method shall take no parameters and return a double value. This method should compute and return the average opening price of all stock data in the StockList. o findMaxHigh Price: This method shall take no parameters and return a single TeslaStock object. ▪ This method should compute and return the maximum high price of all the stock data. ■ ■
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education