Java实战项目拼电商客户管理系统(未完成)

实战项目、拼电商客户管理系统

模拟实现一个基于文本界面的《拼电商客户管理系统》进一步掌握编程技巧和调试技巧,熟悉面向对象编程主要涉及以下知识点:
>类结构的使用:属性、方法及构造器
>对象的创建与使用
>类的封装性声明和使用数组
>数组的插了.删除和替换
>关键字的使用: thisJava实战项目拼电商客户管理系统(未完成)_第1张图片

 Java实战项目拼电商客户管理系统(未完成)_第2张图片

 

Java实战项目拼电商客户管理系统(未完成)_第3张图片

Java实战项目拼电商客户管理系统(未完成)_第4张图片Java实战项目拼电商客户管理系统(未完成)_第5张图片 

Java实战项目拼电商客户管理系统(未完成)_第6张图片 

 

public class Customer1 {
    //属性
    private String name;
    private char gender;
    private int age;
    private  String phone;
    private String email;
    //构造器
    public Customer1(){
    }



    public Customer1(String name, char gender, int age, String phone, String email){
        this.name = name;
        this.gender = gender;
        this.age = age;
        this.phone = phone;
        this.email = email;
    }

    //方法

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public char getGender() {
        return gender;
    }

    public String getPhone() {
        return phone;
    }

    public String getEmail() {
        return email;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setGender(char gender) {
        this.gender = gender;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public void setEmail(String email) {
        this.email = email;
    }
}
/**
 * 。CustomerList为Customer对象的管理模块,内部使用数组管理一组Customer对象
 */

public class CustomerList {

    private Customer1[] customer1s;//用来保存客户对象数组
    private int total;//记录已保存客户对象的数量

    //方法

    /**
     * 用途:构造器,用来初始化customer的数组
     * 参数:total Customer:指定customers数组的最大空间
     * @param totalCustomer
     */
    public CustomerList(int totalCustomer){
        customer1s = new Customer1[totalCustomer];
    }

    /**
     *用途:将参数customer添加组中最后一个客户对象记录之后
     * 参数
     * @param customer 指定要添加的客户对象
     * @return添加成功返回true:false表示数组已满,无法添加
     */
    public boolean addCustomer(Customer1 customer){
        if(total= 0&&index0 || index>=total){
            return false;
        }
        for(int i= index;i < total-1;i++){
            customer1s[i] = customer1s[i+1];
        }

        //将有效数据最后一个位置置空
        customer1s [--total]= null;
        return true;
    }

    /**
     * 用途:返回数组中记录的所有客户对象
     *
     * @return Customer[] 数组中包含了当前所有客户对象,该数组长度与对象个数相同。
     */
    public Customer1[] getAllCustomers(){
        Customer1[] custs = new Customer1[total];
        for(int i = 0;i=total){
            return null;
        }else{
            return customer1s[index];
        }

    }

    /**
     * 获取客户列表的数量
     * @return total
     */
    public int getTotal(){

        return total;
    }
}

 

public class CustomerView {
    CustomerList customerList = new CustomerList(16);

    public void enterMainMenu(){

        Boolean loopFlag = true;
        //显示桌面
        while(true){
            System.out.println("——————————————————————拼电商客户管理系统——————————————————————");
            System.out.println("                      1 添 加 客 户");
            System.out.println("                      2 修 改 客 户");
            System.out.println("                      3 删 除 客 户");
            System.out.println("                      4 客 户 列 表");
            System.out.println("                      5 退 出");

            char key = CMUtility.re


            switch(key){
                case 1:

                    break;
                case 2:

                    break;
                case 3:

                    break;
            }
        }
    }
    private void modifyCustomer(){

    }
    private void deleteCustomer(){

    }
    private void listAllCustomers(){

    }
    public static void main(String[] args){

    }

}

你可能感兴趣的:(java,开发语言)