Question
C++ Programming Modify arrtemp.cpp by removing the preassignment of the data for each array and by adding five new function templates. The first new function
C++ Programming
Modify arrtemp.cpp by removing the preassignment of the data for each array and by adding five new function templates. The first new function template should allow the user to enter the array smallest and largest values excluded from the average calculation. The third new function template should sort the array data array in descending order. The fourth new function template should save the array data to a text file. The fifth new function template should retrieve the array data from the text file. Output should include the average of each numerical array with the smallest and largest values excluded and all three arrays being printed out in descending order twice, once before the text file is saved and once after the array is retrieved from the text file. (Warning - make sure to include the line 'template
arrtemp.cpp:
#include
template
int main() { const int n1 = 5, n2 = 7, n3 = 6; int a[n1] = {2, 4, 6, 8, 10}; float b[n2] = {1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7}; char c[n3] = "HELLO";
cout <<"the integer array" << endl; printarray(a, n1);
cout <<"the float array" << endl; printarray(b,n2);
cout <<"the string is" << endl; printarray(c,n3); return 0; }
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