Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ For the given class code given below, create the associated class definition. Our test cases already have the code below, we just need the
C++
For the given class code given below, create the associated class definition.
Our test cases already have the code below, we just need the correct definition (the information placed in a .h file).
Quarterback::Quarterback(){ pass_completes = 0; pass_attempts = 0; total_yards = 0; touchdowns = 0; intercepts = 0; } void Quarterback::setName(string new_name){ name=new_name; } string Quarterback::getName(){ return name; } void Quarterback::setComp(int x){ pass_completes=x; } int Quarterback::getComp(){ return pass_completes; } void Quarterback::setAtt(int x){ pass_attempts=x; } int Quarterback::getAtt(){ return pass_attempts; } void Quarterback::setYards(int x){ total_yards=x; } int Quarterback::getYards(){ return total_yards; } void Quarterback::setTD(int x){ touchdowns=x; } int Quarterback::getTD(){ return touchdowns; } void Quarterback::setPick(int x){ intercepts=x; } int Quarterback::getPick(){ return intercepts; }
void Quarterback::PassCompleted(int x){ pass_completes+=x; total_yards = total_yards+x; PassAttempted(); } void Quarterback::PassAttempted(){ pass_attempts+=1; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started