Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Complete this using Java and JavaFX In this lab, you'll write a program to download stock prices from the web (Yahoo Finance), and draw a
Complete this using Java and JavaFX
In this lab, you'll write a program to download stock prices from the web (Yahoo Finance), and draw a line chart comparing two stocks Instructions You can use any operating system or environment for this laboratory assignment. You will create a new directory (or IntelliJ IDEA project) called lab09. Perform the following steps 1. Write a function, downloadStockPrices() This function takes a stock ticker symbol (e.g. GOOG), and downloads historical stock data about that organization from Yahoo Finance The URL you will use will look like this: i. http://ichart.finance.yahoo.com/table.csv?s-GOOG&a 1&b 01&c-2 010&d-116e-31&f-2015&g-m ii. s: stock ticker symbol iii. a: starting day iv. b: starting month (0-11) v. c: starting year vi. d: ending day vii. e: ending month (0-11) vii. f: ending year ix. g: period (use 'm' for monthly data) 2. Write a function, drawLinePlot): This function takes two lists of floating point values, which are stock closing price values . Use 2D graphics to draw the x-axis and y-axis 50 pixels from the left and bottom edge of the window Call plotLine() (below) twice, once for each stock 3. Write a function, plotLine(): Use 2D graphics to draw lines between each closing price i. Note: You'll need to adjust for the size of the window, the 50 pixel pad around the outside, and for the inverted y-axis Write some code to call the above functions in order to generate a graph similar to that shown in figure 1 (you can hard code the stock symbols, but I would recommend you try out a few different stocks, for thorough testing) 4. Figure 1: The application's sample output comparing Apple (AAPL: red) and Google (GOOG: blue) In this lab, you'll write a program to download stock prices from the web (Yahoo Finance), and draw a line chart comparing two stocks Instructions You can use any operating system or environment for this laboratory assignment. You will create a new directory (or IntelliJ IDEA project) called lab09. Perform the following steps 1. Write a function, downloadStockPrices() This function takes a stock ticker symbol (e.g. GOOG), and downloads historical stock data about that organization from Yahoo Finance The URL you will use will look like this: i. http://ichart.finance.yahoo.com/table.csv?s-GOOG&a 1&b 01&c-2 010&d-116e-31&f-2015&g-m ii. s: stock ticker symbol iii. a: starting day iv. b: starting month (0-11) v. c: starting year vi. d: ending day vii. e: ending month (0-11) vii. f: ending year ix. g: period (use 'm' for monthly data) 2. Write a function, drawLinePlot): This function takes two lists of floating point values, which are stock closing price values . Use 2D graphics to draw the x-axis and y-axis 50 pixels from the left and bottom edge of the window Call plotLine() (below) twice, once for each stock 3. Write a function, plotLine(): Use 2D graphics to draw lines between each closing price i. Note: You'll need to adjust for the size of the window, the 50 pixel pad around the outside, and for the inverted y-axis Write some code to call the above functions in order to generate a graph similar to that shown in figure 1 (you can hard code the stock symbols, but I would recommend you try out a few different stocks, for thorough testing) 4. Figure 1: The application's sample output comparing Apple (AAPL: red) and Google (GOOG: blue)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