
作者 xyzyl单位 惠州学院按指定的输入输出样例定义一个Computer类。包含两个私有数据成员brand和price;包含四个公有成员函数setBrand(),setPrice(), getBrand(),和getPrice()。裁判测试程序样例#include iostream using namespace std; /* 请在这里填写答案 */ int main() { Computer com; // 使用set方法设置数据成员 com.setBrand(Dell); com.setPrice(5000.88); // 使用get方法获取数据成员 cout 品牌com.getBrand() endl; cout 价格com.getPrice() endl; return 0; }输入样例输出样例品牌Dell 价格5000.88参考示例class Computer { private: string brand; double price; public: void setBrand(string b){ brandb; } void setPrice(double p){ pricep; } string getBrand(){ return brand; } double getPrice(){ return price; } };