Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++: #include #include #include using namespace std; void firstmenu() { } int secondmenu(string Name) { int count; count = 0; char item; ifstream reader; reader.open(Name);

C++:

image text in transcribed

#include #include #include using namespace std; void firstmenu() {

} int secondmenu(string Name) { int count; count = 0; char item; ifstream reader; reader.open(Name); while (!reader.eof()){ reader >> item; count++; } reader.close(); return count; } int thirdmenu(string Name) { int count; count = 0; string item; ifstream reader; reader.open(Name); while (!reader.eof()) { reader >> item; count++; } reader.close(); return count; } void fourthtmenu() {

} void fifthmenu() {

} int main() { string fileName; int menuinput; cout > fileName >> menuinput; ofstream writer; writer.open("output.txt"); if (menuinput == 1) { cout

} else if (menuinput == 5) {

}

return 0; }

This is what I have so far for choice 3 it is working 100% correct for choice 2 it is working but it is off by 2 extra characters on the other choice I need your help

please fix my code or write one so I can understand how to do it thank you so so much.

In this homework, you will be tasked with creating functions to manipulate strings that come from files and then outputting the strings to another file. All of these functions are housed together in a menu. The user will be asked to input a file name and then their menu selection The menu is this: . Get rid of white space 2 Print amount of characters in the file 3. Print amount of words in the file Replace all vowels with 3's 5 Print the file lines in reverse order nput will look like this: "input1.txt 2". You can assume there will be no numbers in the input files.Make sure that you have variables to store both the input file name and the integer selection Menu Items Explained . Delete all spaces between words and print that to the new file, line-by-line 2 Count the number of characters in the whole file, not including spaces, and print that to the new file 3. Count the number of words in the whole file and print that to the new file 4. Replace all vowels with 3's and print that to the new file, line-by-line 5. Given the order of the file lines (Ex: 1 2 3), print to the new file the reverse (Ex: 3 21) Each operation must be performed by a separate function. Submissions will receive a 10 points deduction for every function missing. There should be nothing printed to the console, all input is taken from one file and outputted to another file! The output file should be named output.txt

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

E4-7 Emil Skoda Company had the following adjusted trial balance.?

Answered: 1 week ago