Question: Goal: Learn how to write class definitions. Assignment: A new system is introduced to facilitate the organization and tracking of coding challenges. This system records
Goal: Learn how to write class definitions.
Assignment: A new system is introduced to facilitate the organization and tracking of coding challenges. This system records the participants' details and scores and provides a seamless way to access and update this information.
Write a full class definition for a class named Coder, which has the following members :
Private data members:
A private data member username of type string, representing the coder's unique identifier in the platform.
A private data member skillLevel of type double, indicating the rating of this particular coder.
A private data member challengesSolved of type int, representing the number of challenges completed by this coder.
Public member functions:
A member function called setUsername that accepts a string parameter and assigns it to username. The function returns no value.
A member function called setProblemSkillLevel that accepts a 'doubleparameter and assigns it toskillLevel The function returns no value.
A member function called initChallenges that accepts no parameters and sets challengesSolved to The function returns no value.
A member function called solveChallenge that accepts no parameters and increases challengesSolved by The function returns no value.
A member function called getUsername that accepts no parameters and returns the value of username.
A member function called getSkillLevel that accepts no parameters and returns the value of skillLevel.
A member function called getChallengesSolved that accepts no parameters and returns the value of challengesSolved.
Note: The implementation of the methods should happen outside of the class itself using the Coder:: notation. You must also include any header file that is necessary to define this class and its members.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
