Develop an algorithm in the form of a Raptor to identify and display the names of stocks whose share prices are greater than the mean share price and lower than half the highest share price. The stock names and share prices are stored in the text file stocks.txt, attached, where each stock record is stored on two consecutive lines (stock name in the first, and the share price in the second). The solution must work for any arbitrarily large file containing arbitrary values for stock names and share prices (i.e. the number of stocks must not be hard coded in the algorithm). The algorithm must display the names and share prices of the identified stocks, in the following format: CNE Apex: 50.89 BCD Micro: 123.23 … etc. Hint: Read and store stock names and prices in two separated arrays.
Develop an
The solution must work for any arbitrarily large file containing arbitrary values for stock names and share prices (i.e. the number of stocks must not be hard coded in the algorithm).
The algorithm must display the names and share prices of the identified stocks, in the following format:
CNE Apex: 50.89
BCD Micro: 123.23
… etc.
Hint: Read and store stock names and prices in two separated arrays.
Pls. use Raptor
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images