Question: I need to write a program that takes input from a file that has characters. The file that I mentioned has a single character on

I need to write a program that takes input from a file that has characters. The file that I mentioned has a single character on each of its lines. The purpose of this program is to read each character from the file, and then store each char that it read into a char array. When the whole file is done being read, then we output the array to a new file (called output.txt) that modifies all the characters to upper case and strips all the whitespaces including new lines. Also make sure to use file error checking when you perform the file operations.

I am attaching some pseudo code for this exercise.I need to write a program that takes input from a file

Algorithm/Pseudo-code for Exercise 1 1. ifstream ifs; 2. char iarray1000]; 3. open the input file and check for error, i.e. ifs.open("LabInput3-1.txt'"); if (ifs.fail0) // file open failed. Probably the file does not exist, or // the file is not in the correct location. // To find out where the correction location is, you can // create an output file and open it and check where the // output file is. That is the place where input file should be. Print some message to indicate the error. exit( cstdlib? 1); // include>iarray[count++]) // empty body // This code fragment reads the integers in the file ifs to the integer // array iarray Count is the number of integers read. 5. Convert each character in jarrayll to be uppercase, using toupper) function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!