| CSCI 240 | Fall 2025 |
For this assignment, implement methods for a class called PowerLifter that will represent a single powerlifter.
int main() has been provided for this assignment.
The cpp file that is submitted for grading must be named assign8.cpp.
The PowerLifter class declaration should be placed at the top of a source code file while the method implementations should be placed after the closing curly brace for main().
The PowerLifter class contains six private data members.
The default constructor (i.e. one that takes no arguments) should create a "No Name" powerlifter with a Wilks Coefficient of 1.0, and -1 for all their max lifts.
The following methods are required for the PowerLifter class. They should all be public.
These methods will simply copy the argument value to the corresponding data member.
The only constraint to implement is to ensure the coefficient data member is only changed when the passed in argument value is not a negative value and not a value greater than 2.0.
This method will update the data member representing the max squat value for the powerlifter.
It takes one argument: an integer that holds the potential new max squat value. It returns nothing.
The data member representing the max squat value should only be updated if the passed in value is greater than -1.
These methods follow the same concepts as the setSquat method but work with the data members that represent the max bench value and max deadlift value, respectively.
This method simply returns the sum of the three integer data members. That is: the squat, bench, and deadlift.
This method will return the integer typecast of their Wilks Score, which by default will be a float value.
A powerlifter's Wilks Score is calculated by multiplying their powerlifting total (i.e. the value returned by the method described above) by their Wilks Coefficient.
For example, a powerlifter with a total equal to 2000 lbs and a Wilks Coefficient equal to 0.6 would have a Wilks Score of:
Wilks Score = (2000 * 0.6) Wilks Score = 1200
This method will display a formatted PowerLifter object.
It takes no arguments and returns nothing.
Display values in the following order: first name, last name, coefficient, maximum squat values, maximum bench value, maximum deadlift value, total value, and Wilks score.
The two name data members should be displayed left justified in fields that are 18 characters. The numeric data members, the PowerLifter's total, and the PowerLifter's Wilks Score should be displayed right justified in fields that are 10 characters. The PowerLifter's Wilks coefficient should be displayed with exactly 4 digits after the decimal point.
Make sure to end with a new line character.
The data for this program will be read from an input file. There are multiple files available that can be found on Blackboard with the assignment write-up and here:
The files consist of a set of records for varioushe lifters. Each record represents a single lifter and contains: the first name, the last name, Wilks Coefficient, squat value, bench value, and deadlift value. A record in the file resembles the following:
Daniel Rogness 0.5986 475 345 475
Note: It is okay to assume that if there is a first name in a record, there will be a last name, coefficient, squat value, bench value, and deadlift value.
Refer back to assignment 7 if a reminder is needed about how to work with an input file: Assignment 7 write-up
int main() has been written for this assignment. All that is required is to add the class definition and methods.
The constructor and methods MUST have a documentation box like the ones from the previous assignments.
Hand in a copy of the source code (the CPP file) from Part 2 of the assignment on the autograder and Blackboard.
Input file name? lifters2.txt The input file is lifters2.txt Daniel Rogness 0.5986 475 345 475 1295 775 Jessica Buettner 0.9429 484 237 546 1267 1194 Amanda Lawrence 0.8917 564 287 573 1424 1269 Megan Gallagher 1.0740 309 171 408 888 953