Question: I need help with C++ code can you fix my code? here are issues and here is my code Compiler warnings main.cpp: In function 'int

I need help with C++ code

can you fix my code?

here are issues

I need help with C++ code can you fix my code? here

are issues and here is my code Compiler warnings main.cpp: In function

'int main()': main.cpp:14:17: warning: comparison of integer expressions of different signedness: 'int'

14 1 if (pos != filename.length() - 4) an main.cpp:16:18: warning: comparison

of integer expressions of different signedness: 'int' an 16 | } while

(pos != filename.length() - 4); 1 1: Filename Validation 1/1 Input words.doc

and here is my code

words.txt Your output Enter the name of the input file: Only filenames

Compiler warnings main.cpp: In function 'int main()': main.cpp:14:17: warning: comparison of integer expressions of different signedness: 'int' 14 1 if (pos != filename.length() - 4) an main.cpp:16:18: warning: comparison of integer expressions of different signedness: 'int' an 16 | } while (pos != filename.length() - 4); 1 1: Filename Validation 1/1 Input words.doc words.txt Your output Enter the name of the input file: Only filenames ending in '.txt' are accepted! Enter the name of the input file: Failed to open file for read: words.txt 2: Words 1 Summary 0/1 Output differs. See highlights below. Input words-1.txt Your output Enter the name of the input file: 21 words read in from words-1.txt 12 words written to words-1-even.txt 9 words written to words-1-odd.txt Expected output Enter the name of the input file: 20 words read in from words-1.txt 11 words written to words-1-even.txt 9 words written to words-1-odd.txt 3: Words 1 Even Output is nearly correct; but whitespace differs. See highlights below. Special character legend Input words-1.txt American computer gigantic mushroom acre Your output screen abacus triangle math string typewriter Expected output American computer gigantic mushroom acre screen abacus triangle math string typewriter 4: Words 1 Odda Input words-1.txt Your output River College science classes small being habitat pumpkin learn 5: Words 2 Summary ^ Output differs. See highlights below. Input words-2.txt Your output Enter the name of the input file: 17 words read in from words-2.txt 6 words written to words-2-even.txt 11 words written to words-2-odd. txt Expected output Enter the name of the input file: 16 words read in from words-2.txt 5 words written to words-2-even.txt 11 words written to words-2-odd. txt 6: Words 2 Even Output is nearly correct; but whitespace differs. See highlights below. Special character legend Input words-2.txt Montague Tybalt Mercutio Benvolio Juliet Your output Expected output Montague Tybalt Mercutio Benvolio Juliet 7: Words 2 Odda Input words-2.txt Escalus Paris Capulet Romeo Friar Balthasar Abram Sampson Gregory Peter Your output Nurse 8: Words 3 Summary ^ Output differs. See highlights below. Input words-3.txt Your output Enter the name of the input file: 18 words read in from words-3.txt 11 words written to words-3-even.txt 7 words written to words-3-odd.txt Expected output Enter the name of the input file: 17 words read in from words-3.txt 10 words written to words-3-even.txt 7 words written to words-3-odd.txt 9: Words 3 Even Output is nearly correct; but whitespace differs. See highlights below. Special character legend Input words-3.txt When developing programs be sure Your output to create readable source code Expected output When developing programs be sure to create readable source code 10: Words 3 Odda 1/1 Input words-3.txt Your output I trust you enjoy programming using C++ 8 9 0 1 5 6 1 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() 7 { string filename; int pos; do { cout > filename; 3 pos = filename.find(".txt"); 4 if (pos != filename.length() - 4) cout > word; if (word.length() % 2 == 0) { ofse

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!