Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. public class FerryBoat {
  2. private Map<Integer, Reserva> reserva;
  3.  
  4. public FerryBoat(){
  5. reserva = new HashMap<>();
  6. }
  7. public void criarReserva(Reserva r) throws ReservaExeption {
  8. if (!reserva.containsKey(r.getnReserva())) {
  9. reserva.put(r.getnReserva(), r);
  10. } else {
  11. throw new ReservaExpetion("Erro : Reserva Rep!");
  12. }
  13. }
  14.  
  15. public float getMaiorCarga() {
  16. float total=0;
  17. for(Reserva re : reserva.values()){
  18. total = re.PesoTotReserva();
  19. }
  20. return total;
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement