Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NEED THIS ASAP!!! The text file is avalible here for Download - Select Slow Download: https://ufile.io/wblj7 Youve been hired by Microsoft Monitors to write a

NEED THIS ASAP!!!

The text file is avalible here for Download - Select Slow Download: https://ufile.io/wblj7

Youve been hired by Microsoft Monitors to write a C++ console application that analyzes their stock data over the past eleven years. Use text file MicrosoftStockData.txt as input to the application. The first line of the file contains the column headers. The rest of the lines contain daily Microsoft stock data. Values are separated by spaces into the following columns:

Column

Data type

Purpose

Date

String

Trading date

Close

double

Ending share value on that day.

Volume

int

Number of shares traded during that day.

Open

double

Starting share value on that day.

High

double

Highest share value on that day.

Low

double

Lowest share value on that day.

Here are the first five lines of the file:

date close volume open high low

3/5/2018 93.64 23787950 92.34 94.27 92.26

3/2/2018 93.05 32815660 91.58 93.15 90.86

3/1/2018 92.85 36979700 93.99 94.57 91.84

2/28/2018 93.77 30011960 94.84 95.705 93.63

Read each line of the file, one token at a time, as demonstrated in that great application on Blackboard: Text file input - one token per read. Determine the following from the data:

The date and value of the highest daily stock closing value.

The date and value of the lowest daily stock closing value.

The date and value of the highest daily stock volume.

The date and highest difference between the daily high and low stock values (this is known as volatility).

When determining high and low values, you need separate variables to hold the high and low values. Before the read loop, set the high-value variables to -INT_MAX such that any value it is compared to initially will take that value. Set the low-value variables to INT_MAX such that any value it is compared to initially will take that value. Also before the read loop, print a message indicating which file is being read.

After the read loop, print the number of lines read, and the four high-low results formatted in three columns:

A label

A date

A value

Format all real numbers to two decimal places.

[your program code here]*

[your program output here]**

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

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions