logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

CCPROG2 MP SPECIFICATIONS PART 1 Representing & Processing S&P500 Stock Market Historical Data

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Hi! I uploaded the requirements in the files section. All instructions are there even the restrictions. I badly need someone to do it as I have a flight later and I'm lacking the time.

 

1

CCPROG2 MP SPECIFICATIONS PART 1 サ ル バ ド -ル ・ フ ロ ラ ン テ

AY2021 Term 1

GENERAL INSTRUCTIONS

1. Honesty Policy and Honor Code apply.

2. Make sure that you have read and understood the problem requirements. You will be presented with several challenge 

problems. Each challenge is worth 10 points unless otherwise indicated. You will be given skeleton codes for the challenges 

that you will need to complete.

3. Comply with the specifications and restrictions stated in MP Specs document, and inside the comments in the skeleton codes. 

Non-compliance will result into deductions.

4. You are NOT allowed to use pre-defined library functions that we did not discuss in class (unless specified otherwise).

5. Subject your solution to exhaustive testing to ensure that the solution is logically correct. The following scoring and deductions 

system will be applied.

• A perfect score will be awarded to a compliant and logically correct solution.

• Deductions will be applied based on the severity of the logical error. In the worst case, scenario, a score of 0 will be 

given (meaning the solution is logically incorrect).

• Each compiler warning will result into a deduction of one point. 

• A syntax error will result into a score of 0 for the associated challenge.

6. Submit the required deliverables before the specified deadline.

7. To identify your submission, you will need to indicate your group number as part of the filename. 

8. Question? Press this link and post your question in the Canvas discussion thread: Q&A on the Machine Problem (MP).

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Representing & Processing S&P500 Stock Market Historical Data

I. INTRODUCTION

“Big Data” and “Data Science” are recent buzz words in multiple disciplines including the sciences and engineering. For this machine 

problem, we will represent, and process real-life data generated from the daily buying/selling trading of stocks of the 500 companies 

comprising the S&P500 Index1

.

Watch the following videos for background information about stocks, stock market and stock market indices.

• How does the stock market work?

https://youtu.be/p7HKvqRI_Bo

• Explained | The Stock Market

https://youtu.be/ZCFkWDdmXG8

• What’s an Index? The Dow, S&P 500, and Nasdaq Explained

https://youtu.be/WA3Jhvm4W9k

Figure 1: Image credit: Oliver Elfrenbaum “How does the stock market work?” https://www.youtube.com/watch?v=p7HKvqRI_Bo

1

From https://www.bloomberg.com/quote/SPX:IND: “The S&P 500® is widely regarded as the best single gauge of large-cap U.S. 

equities and serves as the foundation for a wide range of investment products. The index includes 500 leading companies and 

captures approximately 80% coverage of available market capitalization.”

2

Concepts covered in CCPROG2, i.e., arrays, string, structures, and file processing will be applied. Through this MP, you’ll need to 

demonstrate that you can:

• perform data gathering

• design and implement your own data structure for representing, storing, accessing and manipulating stock historical data

• design and implement your own algorithms for the challenge problems in the MP specification

• specify test cases 

• test and debug programs

• properly document and articulate your solution to the MP 

II. CHALLENGES

Challenge #1: Gather Stock Historical Data (SHD) [5 points only]

NOTE: This particular challenge is to be accomplished individually, i.e., it is not for group work. As preliminary task, we need to 

gather stock historical data (we’ll abbreviate these three words as SHD) covering the period 01/01/2018 to 10/29/2021. This is a 

very easy clerical task that can be accomplished in less than 1 hour since the data that we need are downloadable for free from the 

Wall Street Journal website. 

For example, download the data for Amazon (symbol AMZN) from https://www.wsj.com/market-data/quotes/AMZN/historicalprices. Refer to the screenshot shown in Figure 2. Set the start date to 01/01/2018 and the end date to 10/29/2021, and then press 

the “GO” button. Thereafter, press the “DOWNLOAD A SPREADSHEET” button to download the SHD as a CSV file. Open the CSV file 

using Excel.

Figure 2. Screenshot for downloading AMZN stock historical data from 01/01/2018 to 10/29/2021.

3

Figure 3. Screenshot of the downloaded AMZN stock historical data.

As shown in Figure 3, the CSV file contains data organized into six columns identified by the header names Date, Open, High, Low, 

Close and Volume2

. The Open, High, Low, Close are abbreviated as OHLC. Take note of the last row number that contains data. In 

the AMZN example, that row number is 966. Thereafter, delete the 1st row (the row that contains the header names). Save the file 

by clicking on “File”, then “Save As”, and choose “Text (tab delimited) *.txt” as the file format. Save the file with the name 

AMZNorig.txt. Close the file.

Open AMZNorig.txt using Notepad (or any other text editor). On the 1st line, insert the stock name AMZN, then encode at least one 

blank space, and then encode 965 (i.e., 966 – 1) which is the number of rows of SHD values obtained from the Wall Street Journal 

data source. 

Note: you will receive a copy of AMZNorig.txt file together with this MP specification document; open and examine its contents.

Your individual task for this challenge is to choose and gather the SHD for FOUR stocks. Click this link and edit the 5

th column by 

encoding your name on the rows corresponding to the stocks that you have chosen. To obtain the stock data, copy and paste 

https://www.wsj.com/market-data/quotes/AMZN/historical-prices on your browser, then replace AMZN with the appropriate stock 

symbol and proceed as described in the previous paragraphs.

WARNING!!! The number of daily transactions may not necessarily be the same for all stocks! You will need to check the last row 

with data in the Excel file and encode it properly in the text file.

DELIVERABLES (what you need to submit):

Click this link and upload in the shared folder the four text files containing the SHD for the stocks that you have chosen. Make sure 

to follow the stock naming convention which is SYMBOLorig.txt. For example, if you chose Apple which has a symbol of AAPL, then 

the SHD should be saved into a text file named as AAPLorig.txt.

2

“Open” is the stock price per share on the very 1st trade of the day, while “Close” is the price at the end of the day. “High” and 

“Low” are the highest and lowest prices of the stock respectively for the day. “Volume” is the number of trades.

One row of SHD

4

Challenge #2: Date Pre-processing: Make the Format Uniform [10 points]

Your task for this challenge is to write a C program that will first read the contents of an original text file (input file) via input 

redirection. The program logic should first read and store ALL:

• date values (1st column data) from the input file into a 1D array of strings. 

• OHLC values (2nd to 5th column data) from the input file into a 2D array of double data type values.

• Volume values (6th column data) from the input file into a 1D array of double data values.

After reading all the data, the program should then produce via output redirection another text file with the following format:

• The dates are all in uniform format following MM/DD/YYYY. For example, if the original date is “6/8/2021”, then the new 

date in the output file should be “06/08/2021”. Another example, if the original date is “5/3/21”, then the new date should 

be “05/03/2021”. 

• The values for OHLC and Volume should be written in the output file as double data type values with two digits after the 

decimal point.

It is up to you to decide how many white spaces you want to put to separate two data values within the same line of text. Make 

sure that there are NO extraneous values in the output.

Run the exe file in the command line interface with I/O redirection with the following format as follows:

CCPROG2> GROUPNUMBER-C2 < input-file > output-file

If your group number is 2, then your C source code should have the name 02-C2.c and your exe file will be 02-C2.exe. All 

groups with a single digit number (1 to 9) should encode a leading zero in the filename (i.e., 01 to 09).

An example run is shown below:

 CCPROG2> 02-C2 < AMZNorig.txt > AMZN.txt

where AMZNorig.txt is the input text file containing the original SHD, and AMZN.txt is the output text file produced by the program.

Note: you will receive a copy of AMZN.txt file together with this MP specification document; open and examine its contents.

Make sure that you test your solution with different possible date configurations (1 or 2 digits for the month, 1 or 2 digits for the 

day, 2 or 4 digits for the year). It is also strongly recommended that you test your solution using the SHD files for other companies 

(i.e., those that were gathered by the other students).

DELIVERABLES: 

1. Submit your group’s C source code named as GROUPNUMBER-C2.c via Canvas before the indicated submission deadline.

2. For EACH member of the group: Click this link and upload in the shared folder the output files corresponding to the four 

stocks that you have chosen in Challenge #1.

More challenges in Part 2…

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

938 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

511 Answers

Hire Me
expert
Husnain SaeedComputer science

680 Answers

Hire Me
expert
Atharva PatilComputer science

952 Answers

Hire Me

Get Free Quote!

346 Experts Online