Help with programming c++ here is the data. https://learn.vccs.edu/bbcswebdav/pi
ID: 3768386 • Letter: H
Question
Help with programming c++
here is the data. https://learn.vccs.edu/bbcswebdav/pid-82105221-dt-content-rid-76115791_2/courses/NV280.EGR.126.001N.FA15/Data5a.txt
The attached text data file contains an unknown quantity of integers. Write a program that opens the file, counts how many values it contains, and creates a 1D array to store the values. Once the array is populated, calculate the minimum value, maximum value, average, and standard deviation. Also count how many values are greater than the average, and of those values, how many are even. Output all the results (including the count of how many values there are) to a separate text file.
Explanation / Answer
#include <iostream>
using namespace std;
#define n 7
int main()
{
int i, total = 0, y[n] = {6,9,2,4,5,23,12};
for (i=0; i<n; i++)
{
cout<<y[i]<<" ";
total = total + y[i];
}
cout<<" Sum of 7 numbers in an array is = "<<total<<endl;
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.