}
}
System.out.println(animal.getAnimaName());
public class Application { }
public static void main(String[] args) { }
Simulator si = new Simulator(); si.playSound(new Dog()); si.playSound(new Cat());
public class Loan { }
import java.util.Scanner;
public class Application {
public static void main(String[] args) {
Loan loan = new Loan(); float annualInterestRate;
int mortgage;
int loanyear;
float getMonthlyInterestRate(){ }
double getMonthlyPayment(){ }
double getSumPayment(){ }
return getMonthlyPayment() * loanyear * 12;
return mortgage * getMonthlyInterestRate() / (1 - Math.pow((1 / (1 + return annualInterestRate / 12;
getMonthlyInterestRate())), mortgage * 12));
}
}
Scanner sc = new Scanner(System.in);
System.out.print(\); loan.mortgage = sc.nextInt();
System.out.print(\); loan.loanyear = sc.nextInt();
System.out.print(\); loan.annualInterestRate = sc.nextFloat();
System.out.println(\);
System.out.printf(\, loan.getMonthlyPayment()); System.out.println(\);
System.out.printf(\, loan.getSumPayment());
2)程序运行结果
Speed=2200 Amount=200
run dog's cry. Dog
run cat's cry. Cat
please input number of loan account:100 please input number of loan years:1 please input annual interest rate:1.2 monthly payment = 10.00
summary payment = 120.00
四、程序调试报告及总结
(调试中遇到的问题及解决方法,并说明实验过程中对Java知识点的认识及收获等)……
1. 熟悉了文本编辑在编程java中的使用 学会了终端调试 2. 进一步明白了java与c的区别和联系 3. 熟悉了接口和类的区别 4. 学会了怎么用类和串口 5. 学会了在类里头用方法