In Cpp, Use vectors to compute students score
#include <iostream> #include <fstream> #include <vector> #include <iomanip> using namespace std; bool read_in(vector<char> *store, char *path){ ifstream inf(path); if(inf){ char c; while(inf >> c){ store->push_back(c); } inf.close(); return true; } cout << "Error: Unable to load/read file: " << path << endl; return false; } int main(){ vector<char> answers; if(!read_in(&answers, (char*)"CorrectAnswers.txt")){ cin.get(); return 1; } vector<char> student; if(!read_in(&student, (char*)"StudentAnswers.txt")){ cin.get(); return 2; } if(answers.size() != student.size()){ cout << "Error: No. of questions & answers mismatch!" << endl; cin.get(); return 3; } int missed = 0, correct = 0; for(int i = answers.size()-1; 0 <= i; i --){ if(answers[i] != student[i]){ mi...