package 电影商店;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Stack;
public class Manage {
private String filename;
private Stack<String>Outtime;
private String ddl;
private HashMap<String,Integer>info;
Manage(String name){
filename=name;
}
public void record_outtime(String time){
Outtime.push(time);
}
public void record_outtime(){
Date cur=new Date();
SimpleDateFormat format=new SimpleDateFormat("yyyymmdd");
String current=format.format(cur);
Outtime.push(current);
}
public void record_ddl(String dd){
ddl=dd;
}
public void record_ddl(){
Date cur=new Date();
SimpleDateFormat format=new SimpleDateFormat("yyyymmdd");
String current=format.format(cur);
Integer cu=Integer.valueOf(current);
cu=cu+30;
current=Integer.toString(cu);
ddl=current;
}
public void record_omoney(Integer m,String n){
info.put(n,m);
}
public void record_omoney(String time,String n) {
Integer t = Integer.valueOf(time);
Integer d = Integer.valueOf(ddl);
Integer period = (d - t) * 2;
info.put(n,period);
}
public void record_omoney(String n){
Date cur=new Date();
SimpleDateFormat format=new SimpleDateFormat("yyyymmdd");
String current=format.format(cur);
Integer cu=Integer.valueOf(current);
Integer d= Integer.valueOf(ddl);
Integer period=(cu-d)*2;
info.put(n,period);
}
public void get_info(String name){
System.out.println(name+"用户的逾期报告如下:");
for(String k:info.keySet()){
if(k==name){
System.out.print("欠费为:");
Integer money=info.get(k);
System.out.print(money);
}
else continue;
}
}
}