Question
This is in C# Problem Statement Create a program that reads in stocks data from a .csv file. When the program runs, it should do
This is in C#
Problem Statement Create a program that reads in stocks 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 an 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. The program will asks the user the file name which is AU.csv. If the user enters 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 AU.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 stocks, please use adjusted price of the stocks, 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