Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i need a help in programming this C++ ++ program In this lab you will write a program that reads in a text file containing
i need a help in programming this C++++ program
In this lab you will write a program that reads in a text file containing a list of words, and writes two text files, one containing even number of characters, the other containing words with an odd number of characters. The program should begin by prompting the user for the name of the input file. Validate the filename to make sure it ends in .txt. If it does not, re-prompt the user after printing an informative message. For example: Enter the name of the input file: words.doc Only filenames ending in .txt' are accepted! Enter the name of the input file: The program should attempt to open the file for reading. If there is an error (for example, if the file does not exist), then the program should output an error message and exit (by returning 1 from main()). For example: Enter the name of the input file: no_such file.txt Failed to open file for read: no _such file.txt Assuming the file opens successfully, the program should prepare the two output files. These files should be named: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