Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Change the code segment below so that it stops reading eitherat the end of the f

ID: 3613105 • Letter: C

Question

Change the code segment below so that it stops reading eitherat the end of the file or after 10,000 characters have beeninput.    charoneChar;    inteCount;    intcharCount;    eCount = 0    textData >>oneChar;    charCount =0;    while(textData)    {       charCount++;       if(oneChar == 'z')          eCount++;          textData>> oneChar;      }    cout <<"Percentage of letter 'z':"            <<float(eCount) / charCount * 100; Change the code segment below so that it stops reading eitherat the end of the file or after 10,000 characters have beeninput.    charoneChar;    inteCount;    intcharCount;    eCount = 0    textData >>oneChar;    charCount =0;    while(textData)    {       charCount++;       if(oneChar == 'z')          eCount++;          textData>> oneChar;      }    cout <<"Percentage of letter 'z':"            <<float(eCount) / charCount * 100;

Explanation / Answer

char oneChar;    inteCount;    intcharCount;    eCount = 0    textData >>oneChar;    charCount =0;    while(textData&&charCount<10000)    {       charCount++;       if(oneChar == 'z')          eCount++;          textData>> oneChar;      }    cout <<"Percentage of letter 'z':"            <<float(eCount) / charCount * 100;
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote