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.
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.
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 11PE
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
Knowledge Booster
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.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,