In this activity you will create an App that displays the current value of a company’s stock given its ticker symbol.
Create a new app that displays a text box with a button next to it like the following:
When the user taps the button, the app should display the current stock price for the ticker symbol in the text box, like the following:
The app should use theweb->download
function to download the web page:https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22SYMBOL%22)&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=
where
SYMBOL
is the ticker symbol of a company. The stock price is found after the text “Ask”. Use theindex of
andsubstring
functions to extract the stock price and dsiplay it.
Submission
Please show your source code and run your scripts for the instructor or lab assistant.