import java.util.Scanner;
public class XX {
int lastRecord;
int curentRecod;
int usedAmount;
double usedFee;
public void setRcord() {
Scanner scan=new Scanner(System.in);
System.out.print("请输入上月用电量:");
lastRecord=scan.nextInt();
System.out.print("请输入本月用电量:");
curentRecod=scan.nextInt();
}
public int calcUsedAmount() {
usedAmount=curentRecod-lastRecord;
System.out.println("本月用电量:"+usedAmount);
return usedAmount;
}
public double calcUsedFee() {
usedFee=1.2*usedAmount;
System.out.println("本月电费"+usedFee);
return usedFee;
}
public static void main(String[] args) {
XX Free=new XX ();
Free.setRcord();
Free.calcUsedAmount();
Free.calcUsedFee();
}
}