超市会员注册积分查询管理系统

本文介绍了如何构建一个超市会员注册积分查询管理系统,包括创建Member类定义会员信息,设计MemberDao查询方法处理数据库操作,以及TestMember测试类进行功能验证。
摘要由CSDN通过智能技术生成

第一步创建Member标准类

public class Member {
    private  String name;//姓名
    private  int cardId;//会员卡号
    private  String password; //密码
    private  int  score;//积分
    private  String registDate;//开卡日期
    //生成默认构造方法
    public Member() {
    }
    //生成带参构造方法
    public Member(String name, int cardId, String password, int score) {
        this.name = name;
        this.cardId = cardId;
        this.password = password;
        this.score = score;
    }

    public Member(String name, int cardId, String password, int score, String registDate) {
        super();
        this.name = name;
        this.cardId = cardId;
        this.password = password;
        this.score = score;
        this.registDate = registDate;
    }
    //生成getXxxx和setXxx方法
    public String getRegistDate() {
        return registDate;
    }
    public void setRegistDate(String registDate) {
        this.registDate = registDate;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getCardId() {
        return cardId;
    }
    public void setCardId(int cardId) {
        this.cardId = cardId;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public int getScore() {
        return score;
    }
    public void setScore(int score) {
        this.score = score;
    }
}

第二步 创建MemberDao方法查询类

import java.text.SimpleDateFormat;
import java.util.*;

public class MemberDao {
    //创建ArrayList集合用于存储数据
    List<Member> memberList = new ArrayList<Member>();
    //Scanner键盘录入
    Scanner input = new Scanner(System.in);
    //创建菜单的放法me
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值