/****************************************************************** CSCI 240 Assignment 8 Fall 2025 Programmer: Section: Date Due: Purpose: ******************************************************************/ #include #include #include #include using namespace std; //put the class definition here int main() { PowerLifter lifter; ifstream infile; string filename; string first_name, last_name; float coeff; int squat, bench, deadlift; //get the input file name from the user cout << "Input file name? "; cin >> filename; //open the file and make sure that it opened correctly infile.open(filename); if(infile.fail()) { cout << filename << " did not open" << endl; exit(1); } cout << endl << "The input file is " << filename << endl << endl; //get the first name of the first lifter from the input file infile >> first_name; while( infile ) { //get the rest of an input record (last name, wilks coeff, and 3 lift values) infile >> last_name; infile >> coeff; infile >> squat >> bench >> deadlift; //build an object from the input values lifter.setFirst(first_name); lifter.setLast(last_name); lifter.setCoef(coeff); lifter.setSquat(squat); lifter.setBench(bench); lifter.setDeadlift(deadlift); //display the lifter information lifter.display(); //get the next first name of a lifter infile >> first_name; } //close the input file infile.close(); return 0; } //code the methods below this line