1. Your program must contain the three functions listed below, in a single file named proj1.cpp: a) main -This function must appear first in your project cpp file, and will perform the following tasks: rray etements to allocate. This number must be between 100 r. if the user enters aa value outsi Dynamically allocate an array with the number of elements requested by the user, by calling the function allocateArray (described below). After allocating the array, write to stdout and to the output file (out.txt) a line of the form (see sample output file): Allocated array with X elements Open input file nums.txt (must be so named) and read the integers in that file (one integer per line). .. Process the file as you go. You may not read the file more than once When you have filled the existing array, call the calcAvg function and output the average of the integers read up to that point (as a double); and invoke function allocateArray to increase the size of the array by 30%, up to a maximum of 500 elements (enforced in the allocateArray function) Example: The user asks for 200 initial elements. Once you have read and placed into the array the 200th item, calculate and output the average of the values read so far, and invoke allocateArray to expand the array size-new size is 260 (200 * 130%). Output at this stage should be of the form: i. Average so far is YY.ZZ-Array size now X i. Continue to process the file. Upon inserting the 260th item (reaching the capacity of the array), repeat the call, to create an array of size 338 (260 * 130%) ii. Repeat this process until the file has no more integers (the number of integers in the file will be 500 elements or fewer). The number of integers read, and the calculated average must be output before exiting the program: X integers were read and the average was YYY.zzz