the exercise is as follows:
Make a class of name Cashier that contains the private variables customerName, customerName, codigocliente and balance. In the same class declare a method that allows to pay a deposit of money to the balance and another method that allows to withdraw money, both methods will have a parameter.
Make another method that shows me the following information: Client Code: Name and Surname of the Client: The total balance in your account is: Make another class that proves the Cashier class by instantiating 2 objects, the data of the variables will NOT be captured from the keyboard but directly assigned. For an object, invoke the method to payBalance and for the other the method to withdraw. In the end invoke the method that I deploy all the information for each instance.
I have only developed up to the total balance of the account the other part that they ask me what class to prove the Cashier class by instantiating 2 objects, the data of the variables there already I stayed: (
import java.util.*;
class cajero
{
String NombreCliente, ApellidoCliente, CodigoCliente;
double SaldoCliente;
private void CapturarDatosAbono(double abono)
{
Scanner datoscliente = new Scanner(System.in);
System.out.println("Digite el monto a abonar a la cuenta: ");
abono = datoscliente.nextDouble();
SaldoCliente = SaldoCliente + abono;
}
private void CapturarDatosRetiro(double retiro)
{
Scanner datoscliente = new Scanner(System.in);
System.out.println("Digite el monto a retirar de la cuenta: ");
retiro = datoscliente.nextDouble();
SaldoCliente = SaldoCliente - retiro;
}
public void capturardatosabono()
{
CapturarDatosAbono(SaldoCliente);
}
public void capturardatosretiro()
{
CapturarDatosRetiro(SaldoCliente);
}
public void mostrardatos()
{
System.out.println("Codigo del Cliente: "+CodigoCliente);
System.out.println("Nombre Completo del cliente: "+NombreCliente+" "+ApellidoCliente);
System.out.println("Saldo total de la cuenta: "+SaldoCliente);
}
}
class cajeroinstanciado
{
}