String calculateRecPoints(String filename) { ifstream stream(filename.c_str(), ios::binary); if ( !stream ) return "0"; char* buffer = new char[32]; double points = 10; unsigned int x = 0; while (stream) { stream.read(buffer, 30); if (!stream) { break; } x = (unsigned int)*buffer; if (x < 100 && x > 90) { points *= ((double)x / (double)98); } } int finalpoints = (int)(points * points); if (finalpoints > 150) { finalpoints = 150; } return IntToStr(finalpoints); }