Write a program with several functions that perform the following tasks:
Read the following 10 integer numbers from the file data.txt into array A.
10 15 27 89 90 95 27 13 99 33
Call function ReadArray that reads numbers from the file data.txt into an array.
Copy array A into array B in reverse order.
Call function ReverseArray that copies an array into another array in reverse order
Print the elements of Array A and B.
Call function PrintArray that prints the elements of an array of any size
THIS IS OUR ASSIGNMENT AND THIS IS WHAT I HAVE SO FAR I CANT DISPLAY ARRAY A AND B AT THE SAME TIME HELP ME WITH THAT PLEASE.
File Edit Options Buffers Tools C++ Help
#include <iostream>
#include <fstream>
using namespace std;
const int ARRAY_SIZE=10;
void ReadArray(int Array_A[], int ARRAY_SIZE);
void ReverseArray(int Array_A[], int Array_B[], int ARRAY_SIZE);
void PrintArray(int Array_A[], int Array_B[], int ARRAY_SIZE);
int main()
{
int Array_B[ARRAY_SIZE];
int Array_A[ARRAY_SIZE];
ReadArray(Array_A, ARRAY_SIZE);
// PrintArray(Array_A, ARRAY_SIZE);
ReverseArray(Array_A, Array_B, ARRAY_SIZE);
PrintArray(Array_A, Array_B, ARRAY_SIZE);
return 0;
}
void ReadArray(int Array_A[], int ARRAY_SIZE)
{
ifstream inputFile;
inputFile.open("data2.txt");
int i=0;
if(!inputFile)
{
cout << "File does not exist";
}
else
{
while (inputFile)
{
inputFile >> Array_A[i];
i++;
}
}
inputFile.close();
}
void ReverseArray( int Array_A[], int Array_B[],int ARRAY_SIZE)
{
for ( int i=0; i< ARRAY_SIZE; i++)
{
Array_B[ARRAY_SIZE-1-i]=Array_A[i];
}
}
void PrintArray (int Array_A[], int Array_B[],int ARRAY_SIZE)
{