信用卡还款实验
一、题目描述
运用事件与委托实现银行卡与信用卡之间的存储与自动扣款操作
二、问题分析
此功能所需的主要组成类为:
- 银行卡类
- 信用卡类
- 还款委托类
- 代码类
还需熟悉并使用订阅功能
三、源代码
using System;
namespace task3
{
class CreditCard//信用卡类
{
private int money;//还款金额
private string PayDate;//还款日
public void setMoney()
{
Console.Write("需还款的金额:500\n");
//int money = Convert.ToInt32(Console.ReadLine());
this.money = 500;
}
public void setRepaymentDate()
{
Console.Write("还款日期为每月8号\n");
//string repaymentDate = Console.ReadLine();
string repaymentDate = "8";
this.PayDate = repaymentDate;
}
public