Computers and Technology

Write a full class definition for a class named player , and containing the following members: a data member name of type string .a data member score of type int .a member function called setname that accepts a parameter and assigns it to name . the function returns no value. a member function called setscore that accepts a parameter and assigns it to score . the function returns no value. a member function called getname that accepts no parameters and returns the value of name .a member function called getscore that accepts no parameters and returns the value of score .this is what i have, aparently this is wrong: class player{private: string name; int score; public: void player: : setname (string n){name =n; }void player: : setscore (int s){score = s; }string player: : getname (){return name; }int player: : getscore (){return score; }};

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 04:40, Koriunaa
The narrative structure of the popular movies can be broken down into
Answers: 3
image
Computers and Technology, 24.06.2019 00:00, Amrinderkhattra
Visualizing a game of “tag” to remember the meaning of contagious
Answers: 3
image
Computers and Technology, 24.06.2019 14:00, youcandoit13
In simple terms, how would you define a protocol?
Answers: 2
image
Computers and Technology, 24.06.2019 16:30, magalya01
Which program can damage your computer?
Answers: 1
Do you know the correct answer?
Write a full class definition for a class named player , and containing the following members: a dat...

Questions in other subjects:

Konu
Mathematics, 02.12.2021 03:00
Konu
Computers and Technology, 02.12.2021 03:00
Konu
Computers and Technology, 02.12.2021 03:00
Konu
Advanced Placement (AP), 02.12.2021 03:00