Correction devoir controle poo 2019 2020 pdf

Correction DEvoir Controle POO Classe Medecin public class Medecin public ?nal int CodeCNAM private String NomPrenom private String Spécialité public oat Tarif private oat Recette private int Nbcons public Medecin int cc String NP String S oat PT constructeur this CodeCNAM cc this NomPrenom NP this Spécialité S this Tarif PT public int getNbCons pts return Nbcons public void SetNbCons this Nb cons public oat getRecette return Recette public void setRecette oat Recette pts this Recette Recette Cpublic boolean veri ?er Medecin M if this CodeCNAM M CodeCNAM this NomPrenom equals M NomPrenom return true else return false Override public String toString String CH n Code CNAM this CodeCNAM nNom Prenom this NomPrenom nSpécialité this Spécialité nPleinTarif this Tarif return CH Classe Date import java util Calendar class Date private int jour private int mois private int année public Date int j int m int a Cthis jour j this mois m this année a public static Date getDate methode Static de la classe Date int j m a Calendar c Calendar getInstance getInstance c'est l'équivalent d'un constructeur dans la classe Calendar j c get Calendar DAYOFMONTH DAY OF MONTH attribut Static dans calendar m c get Calendar MONTH MONTH attribut Static dans Calendar Veuillez noter que les mois du a c get Calendar YEAR calendrier sont indexés à zéro pour janvier cette méthode renverra Year attribut Static dans calendar Date d new Date j m a création d'un objet de type Date return d Override public String toString return Date getDate jour Date getDate mois Date getDate année classe consultation public class consultation private int CodeCons private String NomPrenomPatient Cprivate String Spécialité private Date DateCons private Medecin LeMedecin private String RégimeCNAMPatient public consultation int cp String NP String RCP String Sp constructeur this CodeCons cp this NomPrenomPatient NP this DateCons Date getDate this RégimeCNAMPatient RCP this Spécialité Sp public boolean A ?ecterMedecin Medecin M oat r if M getNbCons LeMedecin M M SetNbCons r M getRecette CalculerTarifCons M setRecette r return true else return false Cpublic oat calculerTarifCons if this LeMedecin codeCnam this régimeCnamPatient equals Medecin de famille return LeMedecin tarif else return LeMedecin tarif void a ?cher System out println nNom Prenom this NomPrenomPatient nLe this DateCons toString nDr this LeMedecin toString nNet a payer this CalculerPrixPrestation classe TEST import java util Scanner public class TestD public static void main String args Medecin M new Medecin MohamedGhorbel Dentaire Medecin M new Medecin MohssenTaktak Cardio Scanner s new Scanner System in String NP RC S int cc CSystem out println introduire le code de la consultation cc s nextInt System out println introduire le nom et le prenom du Patient NP s next System out println introduire son régime CNAM RC s next System out println introduire la spécialité S s next consultation c new consultation cc NP RC S if c A ?ecterMedecin M c a ?cher C

  • 38
  • 0
  • 0
Afficher les détails des licences
Licence et utilisation
Gratuit pour un usage personnel Aucune attribution requise
Partager
  • Détails
  • Publié le Mar 29, 2022
  • Catégorie Law / Droit
  • Langue French
  • Taille du fichier 48.8kB