Skip to content

Commit 785982d

Browse files
committed
Added Actividad 22 - Unit 14
1 parent 46b7829 commit 785982d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package unit14.Actividad22_Aplicacion;
2+
3+
import unit14.Actividad15_Aplicacion.DAO.OficinaDAO;
4+
import unit14.Actividad15_Aplicacion.Oficina;
5+
import unit14.Funciones.GetData;
6+
7+
import java.util.ArrayList;
8+
9+
/*
10+
Aprovecha el método de la Actividad 21 para mostrar las oficinas cuya superficie es superior a una
11+
extensión introducida por teclado.
12+
*/
13+
public class Actividad22 {
14+
public static void main(String[] args) {
15+
OficinaDAO oficinaDAO = new OficinaDAO(); // Instancia de OficinaDAO
16+
ArrayList<Oficina> oficinas = (ArrayList<Oficina>) oficinaDAO.readAll(); // ArrayList de oficinas
17+
18+
// Pedimos la superficie
19+
int superficie = GetData.getInt("Introduce la superficie: ", 1, Integer.MAX_VALUE);
20+
21+
// Mostramos las oficinas cuya superficie es superior a la introducida
22+
oficinas.stream().filter(oficina -> oficina.getSuperficie() > superficie).forEach(System.out::println);
23+
}
24+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy