Fiz uma parte deste, porem não sei como vou colocar no código para alugar alguma coisa… Se alguém souber, me ajude.
Consegui fazer: Inserir, Remover.
Não consegui: Alugar, Devolver, Listar.
package br.edu.ifmt.estrutura.dados.dominio;
public class Imobiliaria {
private int quantidade;
Imovel definir[] = new Imovel[20];
public boolean Inserir(Imovel imovel) { for (int i = 0; i < definir.length; i++) { if (definir[i] == null) { this.definir[i] = imovel; return true; } } return false; }
public boolean Remover(Imovel imovel) { for (int i = 0; i < definir.length; i++) { if (definir[i] != null) { this.definir[i] = null; return true; } else { return false; } } return false; } public boolean Alugar(Imovel imovel){ } public boolean Devolver(Imovel imovel){ } public String listarImoveis(String filtro){ for (int i = 0; i < definir.length; i++){ if } }
}