subject

For this program you are given a String that represents stock prices for a particular company 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 always assume tha the 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:
// First run
Please enter stock prices: 1,22,30,38,44,68,49,73, 52,66
Highest price: 73 ocurred on day # 7
Lowest price: 1 occurred on day # 0
// pecond run
Please enter stock prices: stock_prices - 41,37,40,54,51,63,54,47,23,33
Highest price: 63 occurred on day # 5
Lowest price: 23 accurred on day # 8
Write your program on the following page. You can use this page for rough work.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:40
Mary's manager told her she should insert a graphic into her documentwrite mary a brief note describing how to insert a graphicin a word processing document.
Answers: 1
question
Computers and Technology, 22.06.2019 21:40
Develop a function to create a document in the mongodb database “city” in the collection “inspections.” be sure it can handle error conditions gracefully. a. input -> argument to function will be set of key/value pairs in the data type acceptable to the mongodb driver insert api call b. return -> true if successful insert else false (require a screenshot)
Answers: 2
question
Computers and Technology, 23.06.2019 06:20
What is a point-in-time measurement of system performance?
Answers: 3
question
Computers and Technology, 23.06.2019 06:40
What are the three uses of a screw?
Answers: 2
You know the right answer?
For this program you are given a String that represents stock prices for a particular company over a...
Questions
question
English, 22.07.2021 08:20
question
Spanish, 22.07.2021 08:20
question
English, 22.07.2021 08:20
question
English, 22.07.2021 08:20
question
Mathematics, 22.07.2021 08:30
Questions on the website: 13722363