Question: Learning Objective: To create a class with 2 class methods, and get and display and set the values for the member variables with the functions.
Learning Objective:
To create a class with class methods, and get and display and set the values for the member variables with the functions.
Part Instructions:
Create and define a class called Player
Create member variables
string name;
int score;
int healthstatus;
string weapon;
int strength;
and class methods member functions one to input, and another one to output.
void input; you may chose to leave empty, or add parameters
void outupt;
Define your class methods outside of the class definition and outside of main using the scope resolution.
EXAMPLE: void Player::inputcode goes here
Member variables should be private, and functions should be public.
In main create objects and apply the input function to both, as well as the output function to both.
NOTE: You may not use your member variables inside of main, only use your functions to access member variables.
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
