C++ Program help the assignment is to create a program that reads a data file that should contain only integers values and thus should contain only digits, plus or minus signs, and whitespace. the program should print any invalid characters located in the file, and at the end it should print a count of the invalid characters located. (print means show in screen). my current attempt is this:

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

C++ Program help the assignment is to create a program that reads a data file that should contain only integers values and thus should contain only digits, plus or minus signs, and whitespace. the program should print any invalid characters located in the file, and at the end it should print a count of the invalid characters located. (print means show in screen). my current attempt is this:

MIT 6.00 Intro Computer Science (OCW)
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

#include #include #include using namespace std; int main() { ifstream fin; int x; fin.open("invalid.txt"); cout <<"state of fin stream:" << endl<>x; while (!fin.eof()) { cout<>x; } cout <<"state of fin stream:" << endl<
i have no idea how to make the program not just crash and burn when it sees a letter in the file, and no idea how to make it display the invalid characters. Pleas help!
I would try to run through the file once, collecting all the invalid characters (into a vector or array of characters), and then print them all out at the end. This would involve: making a storage vector, running through the file finding invalid entries, closing the file, printing out the elements of the array, and then printing out the size of the vector.

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Not the answer you are looking for?

Search for more explanations.

Ask your own question