Question: Hello Chegg Expert, I have a problem in python language. I need to write test cases first for this assignment however I dont know where
Hello Chegg Expert, I have a problem in python language. I need to write test cases first for this assignment however I dont know where to start.
Problem : A user has stocks in many companies. Write a program that will find the net asset value of their stocks and display it.
The program will read a file which has details of stock symbols and the number of shares of each stock the user owns. For example XYZ1 1000 XYZ2 1500 XYZ3 2312 ... XYZI 1000 XYZJ 1000
Assuming the price for each of those stocks on the top is $1, $2, and $3, and the stocks at the bottom are either invalid or runs into error when fetching. Then the output would look like:
Symbol Shares Net Asset Value -------------------------------- XYZ1 1000 $1000.00 XYZ2 1500 $3000.00 XYZ3 2312 $6936.00 ... Total $.....total of all the net asset values...
Errors: XYZI Invalid stock symbol XYZJ Error reaching the network
You may obtain the stock price from the URL http://download.finance.yahoo.com/d/quotes.csv?s=SYMBOL&f=snbaopl1
where SYMBOL should be replaced by a symbol. We can extract the value of the stock price from the numbers returned by this link.
Can you help me write this in Java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
