alguien me podria decir cual es el error porfa gracias
Publicado por leidy (3 intervenciones) el 06/08/2022 05:11:46
El reto nos pide tener 3 clases: Cliente, Cuenta y CuentaCorriente; las 2 últimas deben
heredar de la clase Cliente, no deben tener métodos o procesos, excepto los getter y
setter y los de las clases de las cuentas que deben tener “calcular_interes”.
public class Cliente {
public final long documentoIdentidad;
public final String nombre;
public String correoElectronico;
public int numeroCelular;
public String direccionComunicaciones;
public Cliente(long documentoIdentidad, String nombre, String correoElectronico,
int numeroCelular, String direccionComunicaciones) {
this.documentoIdentidad = documentoIdentidad;
this.nombre = nombre;
this.correoElectronico = correoElectronico;
this.numeroCelular = numeroCelular;
this.direccionComunicaciones = direccionComunicaciones;
}
public long getDocumentoIdentidad() {
return documentoIdentidad;
}
public String getNombre() {
return nombre;
}
public String getCorreoElectronico() {
return correoElectronico;
}
public int getNumeroCelular() {
return numeroCelular;
}
public String getDireccionComunicaciones() {
return direccionComunicaciones;
}
public void setCorreoElectronico(String correoElectronico) {
this.correoElectronico = correoElectronico;
}
public void setNumeroCelular(int numeroCelular) {
this.numeroCelular = numeroCelular;
}
public void setDireccionComunicaciones(String direccionComunicaciones) {
this.direccionComunicaciones = direccionComunicaciones;
}
}
public class Cuenta extends Cliente {
public final long numeroCuenta;
public final String fechaApertura;
public int tipoCuenta;
public double saldoCuenta;
public Cuenta(long numeroCuenta, String fechaApertura, int tipoCuenta, double
saldoCuenta) {
this.numeroCuenta = numeroCuenta;
this.fechaApertura = fechaApertura;
this.tipoCuenta = tipoCuenta;
this.saldoCuenta = saldoCuenta;
}
public long getNumeroCuenta() {
return numeroCuenta;
}
public String getFechaApertura() {
return fechaApertura;
}
public int getTipoCuenta() {
return tipoCuenta;
}
public double getSaldoCuenta() {
return saldoCuenta;
}
public void setTipoCuenta(int tipoCuenta) {
this.tipoCuenta = tipoCuenta;
}
public void setSaldoCuenta(double saldoCuenta) {
this.saldoCuenta = saldoCuenta;
}
public double calcular_interes() {
double interesMensualCuenta;
interesMensualCuenta = 0d;
switch (this.tipoCuenta) {
case 1:
interesMensualCuenta = saldoCuenta * 1.5 / 100;
break;
case 2:
interesMensualCuenta = saldoCuenta * 1.7 / 100;
break;
case 3:
interesMensualCuenta = saldoCuenta * 1.6 / 100;
break;
}
return interesMensualCuenta;
}
}
public class CuentaCorriente extends Cliente {
public final long numeroCuenta;
public final String fechaApertura;
public double saldoCuenta;
public double porcentajeInteresMensualCuenta;
public double valorSobregiroPermitido;
public CuentaCorriente(long numeroCuenta, String fechaApertura,
double saldoCuenta, double porcentajeInteresMensualCuenta,
double valorSobregiroPermitido) {
this.numeroCuenta = numeroCuenta;
this.fechaApertura = fechaApertura;
this.saldoCuenta = saldoCuenta;
this.porcentajeInteresMensualCuenta = porcentajeInteresMensualCuenta;
this.valorSobregiroPermitido = valorSobregiroPermitido;
}
public long getNumeroCuenta() {
return numeroCuenta;
}
public String getFechaApertura() {
return fechaApertura;
}
public double getSaldoCuenta() {
return saldoCuenta;
}
public double getPorcentajeInteresMensualCuenta() {
return porcentajeInteresMensualCuenta;
}
public double getValorSobregiroPermitido() {
return valorSobregiroPermitido;
}
public void setSaldoCuenta(double saldoCuenta) {
this.saldoCuenta = saldoCuenta;
}
public void setPorcentajeInteresMensualCuenta(double
porcentajeInteresMensualCuenta) {
this.porcentajeInteresMensualCuenta = porcentajeInteresMensualCuenta;
}
public void setValorSobregiroPermitido(double valorSobregiroPermitido) {
this.valorSobregiroPermitido = valorSobregiroPermitido;
}
public double calcular_interes() {
return saldoCuenta * porcentajeInteresMensualCuenta / 100;
}
}
Me está arrojando estos 2 errores:
Syntax Error(s)
__tester__.java:55: error: constructor Cliente in class Cliente cannot be applied to given
types;
public Cuenta(long numeroCuenta, String fechaApertura, int tipoCuenta, double
saldoCuenta) {
^
required: long,String,String,int,String
found: no arguments
reason: actual and formal argument lists differ in length
__tester__.java:111: error: constructor Cliente in class Cliente cannot be applied to
given types;
public CuentaCorriente(long numeroCuenta, String fechaApertura, double
saldoCuenta, double porcentajeInteresMensualCuenta, double valorSobregiroPermitido) {
^
required: long,String,String,int,String
found: no arguments
reason: actual and formal argument lists differ in length
2 errors
heredar de la clase Cliente, no deben tener métodos o procesos, excepto los getter y
setter y los de las clases de las cuentas que deben tener “calcular_interes”.
public class Cliente {
public final long documentoIdentidad;
public final String nombre;
public String correoElectronico;
public int numeroCelular;
public String direccionComunicaciones;
public Cliente(long documentoIdentidad, String nombre, String correoElectronico,
int numeroCelular, String direccionComunicaciones) {
this.documentoIdentidad = documentoIdentidad;
this.nombre = nombre;
this.correoElectronico = correoElectronico;
this.numeroCelular = numeroCelular;
this.direccionComunicaciones = direccionComunicaciones;
}
public long getDocumentoIdentidad() {
return documentoIdentidad;
}
public String getNombre() {
return nombre;
}
public String getCorreoElectronico() {
return correoElectronico;
}
public int getNumeroCelular() {
return numeroCelular;
}
public String getDireccionComunicaciones() {
return direccionComunicaciones;
}
public void setCorreoElectronico(String correoElectronico) {
this.correoElectronico = correoElectronico;
}
public void setNumeroCelular(int numeroCelular) {
this.numeroCelular = numeroCelular;
}
public void setDireccionComunicaciones(String direccionComunicaciones) {
this.direccionComunicaciones = direccionComunicaciones;
}
}
public class Cuenta extends Cliente {
public final long numeroCuenta;
public final String fechaApertura;
public int tipoCuenta;
public double saldoCuenta;
public Cuenta(long numeroCuenta, String fechaApertura, int tipoCuenta, double
saldoCuenta) {
this.numeroCuenta = numeroCuenta;
this.fechaApertura = fechaApertura;
this.tipoCuenta = tipoCuenta;
this.saldoCuenta = saldoCuenta;
}
public long getNumeroCuenta() {
return numeroCuenta;
}
public String getFechaApertura() {
return fechaApertura;
}
public int getTipoCuenta() {
return tipoCuenta;
}
public double getSaldoCuenta() {
return saldoCuenta;
}
public void setTipoCuenta(int tipoCuenta) {
this.tipoCuenta = tipoCuenta;
}
public void setSaldoCuenta(double saldoCuenta) {
this.saldoCuenta = saldoCuenta;
}
public double calcular_interes() {
double interesMensualCuenta;
interesMensualCuenta = 0d;
switch (this.tipoCuenta) {
case 1:
interesMensualCuenta = saldoCuenta * 1.5 / 100;
break;
case 2:
interesMensualCuenta = saldoCuenta * 1.7 / 100;
break;
case 3:
interesMensualCuenta = saldoCuenta * 1.6 / 100;
break;
}
return interesMensualCuenta;
}
}
public class CuentaCorriente extends Cliente {
public final long numeroCuenta;
public final String fechaApertura;
public double saldoCuenta;
public double porcentajeInteresMensualCuenta;
public double valorSobregiroPermitido;
public CuentaCorriente(long numeroCuenta, String fechaApertura,
double saldoCuenta, double porcentajeInteresMensualCuenta,
double valorSobregiroPermitido) {
this.numeroCuenta = numeroCuenta;
this.fechaApertura = fechaApertura;
this.saldoCuenta = saldoCuenta;
this.porcentajeInteresMensualCuenta = porcentajeInteresMensualCuenta;
this.valorSobregiroPermitido = valorSobregiroPermitido;
}
public long getNumeroCuenta() {
return numeroCuenta;
}
public String getFechaApertura() {
return fechaApertura;
}
public double getSaldoCuenta() {
return saldoCuenta;
}
public double getPorcentajeInteresMensualCuenta() {
return porcentajeInteresMensualCuenta;
}
public double getValorSobregiroPermitido() {
return valorSobregiroPermitido;
}
public void setSaldoCuenta(double saldoCuenta) {
this.saldoCuenta = saldoCuenta;
}
public void setPorcentajeInteresMensualCuenta(double
porcentajeInteresMensualCuenta) {
this.porcentajeInteresMensualCuenta = porcentajeInteresMensualCuenta;
}
public void setValorSobregiroPermitido(double valorSobregiroPermitido) {
this.valorSobregiroPermitido = valorSobregiroPermitido;
}
public double calcular_interes() {
return saldoCuenta * porcentajeInteresMensualCuenta / 100;
}
}
Me está arrojando estos 2 errores:
Syntax Error(s)
__tester__.java:55: error: constructor Cliente in class Cliente cannot be applied to given
types;
public Cuenta(long numeroCuenta, String fechaApertura, int tipoCuenta, double
saldoCuenta) {
^
required: long,String,String,int,String
found: no arguments
reason: actual and formal argument lists differ in length
__tester__.java:111: error: constructor Cliente in class Cliente cannot be applied to
given types;
public CuentaCorriente(long numeroCuenta, String fechaApertura, double
saldoCuenta, double porcentajeInteresMensualCuenta, double valorSobregiroPermitido) {
^
required: long,String,String,int,String
found: no arguments
reason: actual and formal argument lists differ in length
2 errors
Valora esta pregunta
0