Question
This is in C# on Visual Studio, I made the note (*) with the different headers in the csv file because I am not sure
This is in C# on Visual Studio, I made the note (*) with the different headers in the csv file because I am not sure how to upload that to go along with this
Create a program that reads in stock data from a .csv file. When the program runs, it should do the following: Create a Date class that does the following: o A default constructor o A constructor with a string argument o An integer member variable that represents date in the following format: YYYYMMDD i.e. 20070212 means February 12, 2007 o A string member variable that represents date in the following format: YYYY-MM-DD o An integer member variable that represents a year o An integer member variable that represents a month o An integer member variable that represents a day of the month o A method that converts a YYYY-MM-DD into YYYYMMDD o A method that converts a YYYYMMDD into YYYY-MM-DD o A method that extracts only the year from YYYYMMDD o A method that extracts only the month from YYYYMMDD o A method that extracts only the day from YYYYMMDD
Create a Stock Class: this class will represent a stock. You need to decide the member variables of this class based on the input file. This input file is given to you and it is a comma-separated-value file (.csv). This class must have a Date type member variable. Use properties for all of the private member variables/fields.
* In the input file the different columns are for Date, Open, High, Low, Close, Adj Close, and Volume. All of the numbers in the file except for the Volume are of double type
The program will ask the user for the file name which is FB.csv. If the user enters an incorrect file name, the program terminates after displaying an error message on the Console. If the file name is correct, it creates a List of stocks and put all of the stock data into list. Each stock object represents one row of data from the FB.csv file.
After reading all of the stock data into the program, create a method in the Main class named MeanPrice, which calculates the average price of the stock, Facebook. This method returns a double value.
Create a method in the Main class named HighestPrice, which returns the highest price of the stock and its date. Create a method in the Main class named LowestPrice, which returns the LowestPrice of the stock and its date. Output The program will display the mean price of the stock on the Console. It also displays the highest price and lowest price along with their corresponding dates on the Console.
Note When calculating the mean, highest, and lowest price of the stock, please use adjusted price of the stock, NOT open, close, high, or low.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started