subject

Stock Market For this program you are given a String that represents stock prices for a particular com- y over a period of time. For example, you may be given a String that looks like the following:
String stockPrices = "1,22,30,38,44,68,49,73,52,66";
Each number in this String represents the stock price for a particular day. The first number is day 0, the second number is day 1, and so on. You can al supplied string will formatted using commas to separate daily stock prices. The individual stock prices will always be valid integers, but they many not always be the same number of digits (i. e. 1 is a valid stock price, as is 1000. Your program should work with strings of any length. The "split" method might come in handy for this problem. Your task is to analyze the supplied string and determine the following:
• The highest price for the stock
• The day when the highest price occurred
• The lowest price for the stock
• The day when the lowest price occurred
Here are two sample runnings of the program:
1 // First run
2 Please enter stock prices: 1,22,30,38,44,68,49,73,52,66
3 Highest price: 73 occurred on day # 7
4 Lowest price: 1 occurred on day # 0
5 // second run
6 Please enter stock prices: stock_prices = 41,37,40,54,51,63,54,47,23,33
7 Highest price: 63 occurred on day # 5
8 Lowest price: 23 occurred on day # 8

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 15:40
Most networking media send data using in which data is represented by only two discrete states: 0s and 1s. a. digital signals b. contiguous signals c. ramp signals d. exponential signals
Answers: 1
question
Computers and Technology, 22.06.2019 10:00
You need a reliable network for about twenty-five computers that will be distributed across a large building. it is important that the network be relatively cheap. which topology should you use?
Answers: 1
question
Computers and Technology, 22.06.2019 10:30
How can a user open a blank presentation? 1.on the file menu, click new, and then click recent templates 2.on the file menu, click new, and then click blank presentation 3. on the view menu, click templates, and then click recent templates 4. on the view menu, click samples, and then click blank presentation
Answers: 1
question
Computers and Technology, 22.06.2019 19:00
If your accelerator suddenly gets stuck what should you do
Answers: 2
You know the right answer?
Stock Market For this program you are given a String that represents stock prices for a particular...
Questions
question
Mathematics, 27.08.2020 20:01
Questions on the website: 13722363