Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago