Migliorata data
This commit is contained in:
@@ -11,7 +11,7 @@ import veicoli.VeicoloAMotore;
|
|||||||
* @author Verde
|
* @author Verde
|
||||||
*/
|
*/
|
||||||
public class Garage {
|
public class Garage {
|
||||||
public static final int DIMENSIONE_GARAGE = 2;
|
public static final int DIMENSIONE_GARAGE = 15;
|
||||||
VeicoloAMotore[] veicoli = new VeicoloAMotore[DIMENSIONE_GARAGE];
|
VeicoloAMotore[] veicoli = new VeicoloAMotore[DIMENSIONE_GARAGE];
|
||||||
|
|
||||||
public int immettiNuovoVeicolo(VeicoloAMotore v) throws ArrayIndexOutOfBoundsException {
|
public int immettiNuovoVeicolo(VeicoloAMotore v) throws ArrayIndexOutOfBoundsException {
|
||||||
|
|||||||
@@ -83,8 +83,6 @@ public class MainGarage {
|
|||||||
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
|
||||||
Date annoImmatricolazioneDate;
|
Date annoImmatricolazioneDate;
|
||||||
String[] data;
|
|
||||||
String anno;
|
|
||||||
boolean error;
|
boolean error;
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
String scelta;
|
String scelta;
|
||||||
@@ -105,9 +103,7 @@ public class MainGarage {
|
|||||||
pausa();
|
pausa();
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
data = annoImmatricolazioneDate.toString().split("\\s");
|
annoImmatricolazione = Integer.parseInt(sdf.format(annoImmatricolazioneDate));
|
||||||
anno = data[data.length - 1];
|
|
||||||
annoImmatricolazione = Integer.parseInt(anno);
|
|
||||||
}
|
}
|
||||||
} catch (ParseException _) {
|
} catch (ParseException _) {
|
||||||
System.out.println("Errore nella lettura della data.");
|
System.out.println("Errore nella lettura della data.");
|
||||||
|
|||||||
Reference in New Issue
Block a user