Question
Write a c++ program to load two column of numbers , do arithmetic operations to the data points by following the steps below carefully .
Write a c++ program to load two column of numbers, do arithmetic operations to the data points by following the steps below carefully. Also capture the running time in microseconds for each of these and also the time taken for basic operation.
Steps to complete.
0. Download the data file named Datafile1.data from the file area of the assignment.
1. Load two columns of data points, each column into a storage area, preferably a vector.
2. Initialize/start the clock to capture start of addition clock.
3. Call function to add each position of the data and store it in another storage area.
4. Capture the clock for capturing time end for additions.
5. Start the clock for capturing multiplication
6. Multiply each position of the data and store it to another storage area.
7. Capture the clock for end of multiplications.
8. Write the results of addition and multiplication to a file named Output.data (output file must contain formatted columns of Input column1, input column2 and addition column, multiplication column in each line.)
Your program should print a formatted output to the screen containing
1. Print elapsed time for addition in microseconds.
2. Print basic operation time for addition in nanoseconds.
3. Print elapsed time for multiplication in microseconds.
4. Print basic operation time for multiplication in nanoseconds.
Datafile1.data
9.144548371 0.62072663 7.766500067 1.107554175 6.428523445 0.409904615 4.864271967 1.142139412 7.064106885 1.138740729 2.262955152 1.198965847 9.800966285 0.624420569 8.466914743 0.172152387 7.089199692 0.650149663 6.042680886 0.526675179 1.320701358 0.893658642 3.576178301 0.966546628 4.939756105 0.53583099 3.386905283 0.24428521 5.231554752 0.660683916 3.736280728 0.378121052 7.527971435 0.917047269 2.533630929 1.029850114 9.188222671 0.237647807 1.800088589 0.763132902 9.702171329 1.187835787 4.713240732 0.602808579 0.350114291 0.126105779 1.375572924 0.534626533 3.699384174 0.670885379 7.183110563 1.327536861 7.434890545 1.174302317 9.781202522 1.271484048 7.153021655 0.99647769 0.516259776 0.868291689
C++ PLEASE HELP!!!
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