Question: Write a program that reads a comma-separated file (CSV) with integer values. Your program will take the file name as the input. If the

Write a program that reads a comma-separated file (CSV) with integer values.

Your program will take the file name as the input. If the  

Write a program that reads a comma-separated file (CSV) with integer values. Your program will take the file name as the input. If the file does not exist, then the program must print. Error: input file not found! And, the program is terminated If the program opens the file successfully, the program will output the number of integers read from the file and store the numbers into an array. The program then accepts a user input integer to specify the number of shifts to the left that need to take place to the array For example, given the following CSV file "input1.csv": 1,22,50,38,6 and a user input integer 2 for shifting, the output of your program must be 5 50 38 6 1 22 Implement a function, left_shift() with return type void, to achieve the above shifting This function will take three parameters as input in the following order. an integer array an integer specifying the size of the array an integer specifying the number of shifts Your left shift() function will be tested separately via unit tests. You can safely assume that the numbers of integers in the testing csv files are at most 100 NOTE if you hard code the output, you will receive zero for this exercise 1 //Include the proper headers 2 3 using namespace std;; 4 5 //Implement your left shift function below 6 void left shift (int [], int, int); 7 8 int main() 90 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 32738 26 29 X const int MAX _SIZE = 100; int numbers [MAX_SIZE]; string filename; cin >> filename; // Add other variables below // Read from the csv file // Shift the elements in the integer array to the Left by n positions, n is input by the user // Output the number of elements found in the csv file. //Output the shifted integer array. The integers are separated by a space return 0;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

include include include using namespace std const int MAXSIZE 100 void left... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Economics Questions!