编程题目:使用C++语言模拟完成一个简单的计算机系统(举一个管理人员的例子,其他的例子与下述方法一致即可)
#include<iostream.h>
#include<math.h>
#include<string.h>
class star
{
star *next;
public:
char star_num[20];
char star_name[30];
double star_money;
void afterIn(star *p);
void afterDelete();
star *getNext()
{
return next;
}
void getmessage();
void changemessage(int a,char *p1);
void changemoney(double p);
star(char *num,char *name,double money);
star();
};
void star::changemoney(double p)
{
star_money=p;
}
star::star()
{
strcpy(star_num,"\0");
strcpy(star_name,"\0");
star_money=0;
next='\0';
}
star::star(char *num,char *name,double money)
{
strcpy(star_num,num);
strcpy(star_name,name);
star_money = money;
next = '\0';
}
void star::afterIn(star *p)
{
p->next = next;
next = p;
}
void star::afterDelete()
{
star *p = next;
next = p->next;
delete p;
}
void star::getmessage()
{
cout<<"会员电话号码:"<<star_num<< "会员姓名:"<<star_name;
cout<<"现有余额:"<<star_money<<endl;
}
void star::changemessage(int n, char *