Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java - File IO, Interfaces 21.7 HW 7 - File IO and Interfaces Homework 7: File IO and Interfaces Due on zyBooks Monday, November 12
Java - File IO, Interfaces
21.7 HW 7 - File IO and Interfaces Homework 7: File IO and Interfaces Due on zyBooks Monday, November 12 2018 1 Objective For this assignment, students will practice interfaces, File I0, polymorphism, and inheritance. 2 Problem Write a Java program that performs operations on stock data. Instead of gathering live stock prices, we will mock our data using File I0. In order to do so, you will be given a file with stock ticker symbols and their corresponding prices. A stock ticker symbol uniquely describes a company's stock price (e.g. Apple has ticker symbol AAPL). When a company issues shares to the public marketplace, it selects an available ticker symbol for its securities that investors use to place trade orders. A tick is any change in the price. This change can be either an increase or decrease in the price. A stock ticker automatically displays these ticks, along with other relevant information, like volume, that investors use to stay informed about current market conditions. We will ignore all other information for this assignment and assume that what we read in our program is the current price The example below displays the contents of a file, Service1.txt AAPL 1.25 GOOG 122.4 MSET 22.3 ORCL 4.32 AMZN 123.4 INTC 4.53 XXYZ -2.50 Here, we can see the price for Apple (AAPL) is 1.25, the price for Google (GOOG) is 1224, Microsoft (MSFT) is 22.3, and so on. As can be seen, some of these prices may be negative. Handling such cases is outlined in section 3. To retrieve these prices from the market, we rely on several stock services. These stock services store prices and ticker symbols from the input file and return price for a given ticker symbol. You will have three stock services and each will return a price for a ticker. In other words, for each service, there will be a corresponding input file. We will use an interface, StockPriceService, to create a blueprint for our concrete classes: UHStockService, ExternalService, and NLPService. Moreover you will compare these services. You will perform operations on these services in a class called StockMachine. The constructor for StockMachine takes a name of a file as a parameter. Then, it reads a certain subset of ticker symbols from a given file and stores them in a private field. The input file will be in the following format: numofTickerSymbols -number of ticker symbols in the file TickerSymbol1 -ticker symbol TickerSymbol2- ticker symbol TickerSymbol3-ticker symbol 21.7 HW 7 - File IO and Interfaces Homework 7: File IO and Interfaces Due on zyBooks Monday, November 12 2018 1 Objective For this assignment, students will practice interfaces, File I0, polymorphism, and inheritance. 2 Problem Write a Java program that performs operations on stock data. Instead of gathering live stock prices, we will mock our data using File I0. In order to do so, you will be given a file with stock ticker symbols and their corresponding prices. A stock ticker symbol uniquely describes a company's stock price (e.g. Apple has ticker symbol AAPL). When a company issues shares to the public marketplace, it selects an available ticker symbol for its securities that investors use to place trade orders. A tick is any change in the price. This change can be either an increase or decrease in the price. A stock ticker automatically displays these ticks, along with other relevant information, like volume, that investors use to stay informed about current market conditions. We will ignore all other information for this assignment and assume that what we read in our program is the current price The example below displays the contents of a file, Service1.txt AAPL 1.25 GOOG 122.4 MSET 22.3 ORCL 4.32 AMZN 123.4 INTC 4.53 XXYZ -2.50 Here, we can see the price for Apple (AAPL) is 1.25, the price for Google (GOOG) is 1224, Microsoft (MSFT) is 22.3, and so on. As can be seen, some of these prices may be negative. Handling such cases is outlined in section 3. To retrieve these prices from the market, we rely on several stock services. These stock services store prices and ticker symbols from the input file and return price for a given ticker symbol. You will have three stock services and each will return a price for a ticker. In other words, for each service, there will be a corresponding input file. We will use an interface, StockPriceService, to create a blueprint for our concrete classes: UHStockService, ExternalService, and NLPService. Moreover you will compare these services. You will perform operations on these services in a class called StockMachine. The constructor for StockMachine takes a name of a file as a parameter. Then, it reads a certain subset of ticker symbols from a given file and stores them in a private field. The input file will be in the following format: numofTickerSymbols -number of ticker symbols in the file TickerSymbol1 -ticker symbol TickerSymbol2- ticker symbol TickerSymbol3-ticker symbol
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started