摘要:
#include<iostream> using namespace std; class TravelStrategy{ public: virtual void travel()=0; }; class AirplaneStrategy:public TravelStrategy{ public 阅读全文
posted @ 2022-12-23 20:39
今天又双叒叕在敲代码
阅读(39)
评论(0)
推荐(0)
摘要:
旅游的出行方式有乘坐飞机旅行、乘火车旅行和自行车游,不同的旅游方式有不同的实现过程,客户可以根据自己的需要选择一种合适的旅行方式。 //Person.java package test23; public class Person { //聚合策略类对象 private TravelStrategy 阅读全文
posted @ 2022-12-23 20:38
今天又双叒叕在敲代码
阅读(30)
评论(0)
推荐(0)
摘要:
#include<iostream> #include<string> using namespace std; class Account; class AccountState{ public: Account *acc; double balance; string stateName; pu 阅读全文
posted @ 2022-12-23 20:37
今天又双叒叕在敲代码
阅读(20)
评论(0)
推荐(0)
摘要:
用Java代码模拟实现课堂上的“银行账户”的实例,要求编写客户端测试代码模拟用户存款和取款,注意账户对象状态和行为的变化。 //Account.java package test22; public class Account { private AccountState state; privat 阅读全文
posted @ 2022-12-23 20:36
今天又双叒叕在敲代码
阅读(26)
评论(0)
推荐(0)
摘要:
#include<iostream> #include<map> #include<ctime> #include<sstream> using namespace std; class AbstractChatroom; //抽象同事类 class Member { protected : Abs 阅读全文
posted @ 2022-12-23 20:35
今天又双叒叕在敲代码
阅读(23)
评论(0)
推荐(0)