求各位大神指条明路
car.java:33: error: constructor carloan in class carloan cannot be applied to given types;
carloan vn= new carloan(price, downpayment);
^
required: no arguments
found: double,double
reason: actual and formal argument lists differ in length
1 error
这个是我的error.
我想知道为什么会出现这样的error.
carloan vn= new carloan(price, downpayment);
^
required: no arguments
found: double,double
reason: actual and formal argument lists differ in length
1 error
这个是我的error.
import java.util.Scanner;
public class car{
public static void main(String[] args){
double price;
double downpayment;
double interest;
int months;
int payment;
Scanner in= new Scanner(System.in);
System.out.print("Please enter the car price: ");
price=in.nextDouble();
System.out.println();
System.out.print("Please enter the amount of downpayment: ");
downpayment=in.nextDouble();
System.out.println();
System.out.print("Please enter the annual interest rate: ");
interest=in.nextDouble();
System.out.println();
System.out.print("Please enter the loan period in months: ");
months=in.nextInt();
System.out.println();
System.out.print("Please enter the number of payments you have paid: ");
payment=in.nextInt();
System.out.println();
carloan vn= new carloan(price, downpayment);
System.out.print("The amount borrowed is: "+ vn.getamountborrowed());
System.out.print("The monthly payment amount is: "+ vn.getmonthlyrate());
}}public class carloan{
private double price;
private double downpayment;
private double interest;
private int months;
public double getamountborrowed(){
return price-downpayment;
}
public double getmonthlyrate(){
double P=price-downpayment;
double R=interest/12;
double B=1+R;
double C= Math.pow(B,months);
double D=R*C;
double E=C-1;
double F=D/E*P;
return price;
}}
我想知道为什么会出现这样的error.
...全文
相关推荐
waterwoodwind#john-hexa--notes#没专业背景的人自学houdini可否请大佬们给我指条明路-x103
没专业背景的人自学houdini,可否请大佬们给我指条明路?我告诉你一条最短,最直、最实惠的通用明路,永远适合于自学一切公开的技术。1)搜索qq群里的相关兴趣群
文明路的店
文明路在广州的城市肌理中占有特殊位置,是商业与社区生活的交汇点。2. 广州这座城市通过其密集的店铺展现了其商业活力和城市气质,成为作者感知广州的直接窗口。广州文明路的历史与特色:3.
如何让商业模式画布给产品指条明路
"本文主要介绍了商业模式画布在产品设计中的应用,强调了其对理解产品商业模式的重要性,并通过解析画布的九大模块,阐述了各模块之间的关联和顺序,旨在帮助交互设计师更好地规划产品策略。商业模式画布是描
phper之路, 给学PHP初学者明路
"php初学者指南,包括PHP与数据库交互、前端技术、CMS系统、服务器环境配置及学习路径建议"在"phper之路, 给学PHP初学者明路"这个主题中,我们主要关注的是PHP编程语言的学习路径和相
中山市东明路路灯改造工程.doc
中山市东明路路灯改造工程.doc


Java SE
