package list.linkedlist.vedioshop;
import java.util.Scanner;
public class test {
VedioList vedios=new VedioList();
CustomerList customers=new CustomerList();
Vedio vedio;
Customer customer;
public void createVediolist(){
vedio=new Vedio("Avatar", "Sam Worthington", "Jon Landau", "James Cameron", "Twentieth (20th) Century Fox Film Corporation", 10);
vedios.addVedio(vedio);
vedio=new Vedio("Avatar2", "Sam Worthington", "Jon Landau", "James Cameron", "Twentieth (20th) Century Fox Film Corporation", 20);
vedios.addVedio(vedio);
vedio=new Vedio("aaa", "bbb", "ccc", "ddd", "eee", 10);
vedios.addVedio(vedio);
}
public Vedio makeVedio(){
String movieName;
String starName;
String producerName;
String directorName;
String companyName;
int copyCount=1;
Scanner sc=new Scanner(System.in);
System.out.println("input movieName:");
movieName=sc.nextLine();
System.out.println("input starName:");
starName=sc.nextLine();
System.out.println("input producerName:");
producerName=sc.nextLine();
System.out.println("input directorName:");
directorName=sc.nextLine();
System.out.println("input companyName:");
companyName=sc.nextLine();
vedio=new Vedio(movieName, starName, producerName, directorName, companyName, copyCount);
return vedio;
}
public void register(){
System.out.println("please regist your infomation");
Scanner sc=new Scanner(System.in);
customers.printCustomer();
String firstName,lastName;
System.out.println("your firstName:");
firstName=sc.nextLine();
System.out.println("your lastName:");
lastName=sc.nextLine();
customer=new Customer(firstName, lastName);
customers.addCustomer(customer);
}
public boolean login(){
System.out.println("welcome to vedio shop");
System.out.println("please login first");
Scanner sc=new Scanner(System.in);
String firstName,lastName;
System.out.println("your firstName:");
firstName=sc.nextLine();
System.out.println("your lastName:");
lastName=sc.nextLine();
customer=new Customer(firstName, lastName);
System.out.println(customers.check(customer));
if(customers.check(customer))
return true;
else
return false;
}
public void displayMenu(){
System.out.println("Select one of the following.");
System.out.println("1:To check whether this vedio in the store.");
System.out.println("2:To hire a vedio.");
System.out.println("3:To pay back a vedio.");
System.out.println("4:To show the vedios in the store.");
System.out.println("5:To add my vedio list.");
System.out.println("6:To print my history.");
System.out.println("7:To exit.");
}
public void execute(){
while(true){
displayMenu();
Scanner sc=new Scanner(System.in);
int choice=sc.nextInt();
if(choice==7)
break;
execute(choice);
}
}
public void inserUserVedioList(){
}
private void execute(int choice){
switch (choice) {
case 1:
Scanner sc=new Scanner(System.in);
System.out.println("please input the movieName");
String movieName=sc.nextLine();
if(vedios.isVedioAvailable(movieName))
System.out.println("it can be hired.");
else
System.out.println("it cannot be hired.");
break;
case 2:vedios.checkOut(makeVedio());
break;
case 3:vedios.checkIn(makeVedio());
break;
case 4:vedios.print();
break;
case 5:customer.setHiredVedios(vedio);
break;
case 6:customer.printHiredVedios();
break;
default:
break;
}
}
public static void main(String[] args) {
test t=new test();
t.createVediolist();
while(true){
if(t.login()==true)
break;
System.out.println("login failed!");
t.register();
}
System.out.println("login success!");
t.execute();
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
DataStructTest.rar (31个子文件)
DataStructTest
bin
list
linkedlist
UnorderedLinkedList.class 2KB
OrderedLinkedList.class 2KB
LinkedListClass$LinkedListNode.class 586B
DataElement.class 503B
vedioshop
VedioList.class 2KB
CustomerList.class 2KB
test.class 4KB
Vedio.class 4KB
Customer.class 3KB
LinkedListClass.class 3KB
arraylist
polynomial
Polynomial.class 2KB
test.class 2KB
Calculate.class 3KB
ArrayTest.class 569B
DataElement.class 497B
UnorderedArrayList.class 2KB
ArrayListClass.class 4KB
moneyGame
test.class 1KB
Player.class 1023B
CoinStrip.class 1KB
test
testY.class 909B
testX.class 535B
test.class 524B
.settings
org.eclipse.jdt.core.prefs 598B
src
list
linkedlist
vedioshop
test.java 4KB
CustomerList.java 866B
Vedio.java 4KB
VedioList.java 1KB
Customer.java 2KB
.project 390B
.classpath 299B
共 31 条
- 1
资源评论
- iluphy2015-07-03很不错,挺齐全的
Emmitte
- 粉丝: 122
- 资源: 70
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功