public class Periode { private int annee_deb; private int mois_deb; private int jour_deb; private int annee_fin; private int mois_fin; private int jour_fin; private static int[] JOURS_PAR_MOIS = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; public Periode(int annee_deb, int mois_deb, int jour_deb, int annee_fin, int mois_fin, int jour_fin) { this.annee_deb = annee_deb; this.mois_deb = mois_deb; this.jour_deb = jour_deb; this.annee_fin = annee_fin; this.mois_fin = mois_fin; this.jour_fin = jour_fin; } public String toString() { return String.format("%04d-%02d-%02d - %04d-%02d-%02d", annee_deb, mois_deb, jour_deb, annee_fin, mois_fin, jour_fin); } public Periode periodePlus() { int newJour_fin = this.jour_fin + 1; int newMois_fin = this.mois_fin; int newAnnee_fin = this.annee_fin; if (newJour_fin > JOURS_PAR_MOIS[this.mois_fin - 1]) { newJour_fin = 1; newMois_fin++; if (newMois_fin > 12) { newMois_fin = 1; newAnnee_fin++; } } public int nb_jour(int periode) { if (this.annee_deb == this.annee_fin) { if (this.mois_deb == this.mois_fin) { if (this.jour_deb < jour_fin) { per } } } } public static void main(String[] args) { Periode vacances = new Periode(2025, 02, 17, 2025, 02, 21); Periode periode_plus = vacances.periode_plus(); System.out.println("Votre période est de " + vacances); System.out.println("Voici votre période prolongé : " + vacances.periode_plus()); System.out.println("Voici la durée en jour de votre période : " + periode); } }