本文主要是介绍华恩JAVA班第38天,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
华恩JAVA班第38天
我行我素购物管理系统
package com.zjj;
*文件名称:Admin.java
*功能说明:
*开发人员:Ziu Ginzeon
*创建时间:2013年8月3日 下午2:31:03
public class Admin{
private String name;
private String password;
public Admin(String name, String password) {
this.name = name;
this.password = password;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
package com.zjj;
*文件名称:Person.java
*功能说明:
*开发人员:Ziu Ginzeon
*创建时间:2013年8月3日 下午12:19:16
public class Person {
private String id;
private int year;
private String month;
private String day;
private int score = 0;
public Person(String id, int year, String month, String day, int score) {
super();
this.id = id;
this.year = year;
this.month = month;
this.day = day;
this.score = score;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
public String getMonth() {
return month;
}
public void setMonth(String month) {
this.month = month;
}
public String getDay() {
return day;
}
public void setDay(String day) {
this.day = day;
}
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
}
}
package com.zjj;
*文件名称:Commodity.java
*功能说明:
*开发人员:Ziu Ginzeon
*创建时间:2013年8月3日 下午3:53:38
public class Commodity {
private String name;
private double money;
public Commodity(String name, double money) {
super();
this.name = name;
this.money = money;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getMoney() {
return money;
}
public void setMoney(double money) {
this.money = money;
}
}
package com.zjj;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Scanner;
*文件名称:ShoppingSystemTest.java
*功能说明:
*开发人员:Ziu Ginzeon
*创建时间:2013年8月3日 下午12:21:47
public class ShoppingSystemTest {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
String word ;
Admin admin = new Admin("zxc","123456");
ArrayList arrayList = new ArrayList();
arrayList.add(new Person("10001",1993,"09","08",0));
System.out.println("\t欢迎使用我行我素购物管理系统1.0版");
while(true){
System.out.println("****************************************\n"+
"\t\t1.登录系统\n"+
"\t\t2.更改管理员密码\n"+
"\t\t3.退出\n"+
"****************************************");
System.out.println("请选择,输入数字:");
int a = in.nextInt();
if(a == 1){
while(true){
System.out.println("请输入用户名:");
String name = in.next();
System.out.println("请输入密码:");
String password = in.next();
if(name.equals(admin.getName())&&password.equals(admin.getPassword())){
System.out.println("登录成功");
break;
}else{
System.out.println("输入错误,请重新输入");
}
}
System.out.println("\t欢迎使用我行我素购物管理系统");
while(true){
System.out.println("****************************************\n"+
"\t\t1.客户信息管理\n"+
"\t\t2.购物结算\n"+
"\t\t3.真情回馈\n"+
"\t\t4.注销\n"+
"****************************************\n"+
"请选择,输入数字:");
int b = in.nextInt();
if(b == 1){
while(true){
System.out.println("我行我素购物管理系统->客户信息管理");
System.out.println("****************************************\n"+
"\t\t1.显示所有客户信息\n"+