Skip to content

Conversation

@Crontabman
Copy link
Collaborator

New pull with Cuenta class


public String titular;
public Double cantidad;

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Estas dos propiedades no deberían ser publicas si no primadas para encapsular el código dentro de la clase

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pujolman

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

privadas


public Cuenta(String getTitular, Double getCant) {
this.titular = getTitular;
this.cantidad = getCant;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debería controlarse que la cantidad nunca sea menor a 0

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pujolman


public void retirar(Double cant) {

if(cant > this.cantidad){
Copy link
Owner

@DevFenrils DevFenrils May 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esto esta mal planteado , puesto que plantea que solo se podrá retirar dinero si la cantidad a retirar es mayor a la cantidad existente, debería de plantearse de la siguiente manera:
Si la cantidad a retirar menos la cantidad existente no es menor que 0.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pujolman


public Cuenta cuenta;

public void main(String[] args) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

es " public static void main(String[] args) {"

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pujolman

public void main(String[] args) {
// TODO code application logic here

cuenta = new Cuenta("Jorge Lopez");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Para probar los dos constructores lo mejor seria crear dos objetos Cuenta uno con titular y otro con titular y cantidad

}

private char comprobarSexo(char sexo) {
if (sexo != 'M' || sexo != 'H') {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debería de ser && no || , puesto que H ya es diferente de M , y entraría si solo se pusiera H.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants