بإستخدام ال C++ عرف صف يمثل حساب لاعب Account في لعبة إلكترونية ؟
- برمجة سي بلس بلس
- 2021-05-23
- ahmadghneem
الأجوبة
#include <iostream>
using namespace std;
class Account{
string name;
string nickname;
int score;
public:
Account(string n,string ni,int s){
name=n;
nickname=ni;
score=s;}
void winRound(int roundPoints){
score+=roundPoints;}
void loseRound(int roundPoints){
score-=roundPoints;
if (score<=0){
cout<<"you're out";
}
}
};أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال
معلومات ذات صلة