From 0d62d39cd07bd2762762d1d294bda0a3de71f245 Mon Sep 17 00:00:00 2001 From: La Programmatrice Verde Date: Tue, 4 Nov 2025 22:33:27 +0100 Subject: [PATCH] CalcolaNono --- src/appComune/GestisciCodiceFiscale.java | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/appComune/GestisciCodiceFiscale.java b/src/appComune/GestisciCodiceFiscale.java index f664b34..bbff0b2 100644 --- a/src/appComune/GestisciCodiceFiscale.java +++ b/src/appComune/GestisciCodiceFiscale.java @@ -207,7 +207,8 @@ public class GestisciCodiceFiscale { return ritorno; } - static String quartoQuintoSestoCasoNome(char[] caratteriNome, char primaVocale, int posizionePrimaVocale, int primaConsonante) { + static String quartoQuintoSestoCasoNome(char[] caratteriNome, char primaVocale, int posizionePrimaVocale, + int primaConsonante) { String ritorno; int secondaVocale = trovaSecondaVocale(caratteriNome, posizionePrimaVocale); @@ -239,11 +240,26 @@ public class GestisciCodiceFiscale { } static String CalcolaNono(Date dataNascita) { - + final String[][] TABELLA_CONVERSIONE_MESE = { { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }, + { "a", "b", "c", "d", "e", "h", "l", "m", "p", "r", "s", "t" } }; + final String PATTERN = "MM"; + SimpleDateFormat sdf = new SimpleDateFormat(PATTERN); + int mese = Integer.parseInt(sdf.format(dataNascita)); + boolean exit = false; + String ritorno = ""; + + for (int c = 0; c < TABELLA_CONVERSIONE_MESE[0].length && !exit; c++) { + if (mese == Integer.parseInt(TABELLA_CONVERSIONE_MESE[0][c])) { + ritorno = TABELLA_CONVERSIONE_MESE[1][c]; + exit = true; + } + } + + return ritorno; } static String CalcolaDecimoUndicesimo(Date dataNascita, String sesso) { - + } static String CalcolaFrom12To15(String luogoNascita) {