Question: Here is my question, my current code, my output, and the desired output. It looks like they also want the user to first input the

Here is my question, my current code, my output, and the desired output. It looks like they also want the user to first input the number 20. So I guess the question asked needs to be cout > 20; has to become how many characters are read. It has to count a blank space as a 0.

Here is the question:

Here is my question, my current code, my output, and the desired

Here is my code:

output. It looks like they also want the user to first input

the number 20. So I guess the question asked needs to be

Here is my text file:

cout > 20; has to become how many characters are read. It

Here is the desired output after input of 20:

has to count a blank space as a 0. Here is the

Here is what I am getting now:

question: Here is my code: Here is my text file: Here is

Here it is after I changed it a little:

the desired output after input of 20: Here is what I am

I don't need complete code, although that is usually easier. Just what I need to change to read each answer set correctly.

Right now it is giving scores that are much less that they should be, so it is not reading it correctly.

Thanks ahead of time.

Here is the code pasted:

#include #include #include #include using namespace std; int main() { ifstream inFile; string data; char space; char* answers = new char[21]; unsigned int i; inFile.open("Ch12_Ex2Data.txt"); cout > data) { cout > data; while(i 90) { grade = 'A'; } else if(dpercent > 80) { grade = 'B'; } else if(dpercent > 70) { grade = 'C'; } else if(dpercent > 60) { grade = 'D'; } else { grade = 'F'; } cout

Here is the text file pasted:

TTFTFTTTFTFTFFTTFTTF ABC54102 T FTFTFTTTFTTFTTF TF DEF56278 TTFTFTTTFTFTFFTTFTTF ABC42366 TTFTFTTTFTFTFFTTF ABC42586 TTTTFTTT TFTFFFTF

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!