Devoir java Devoir java Exercie et public class book String titre String auteur int prix public String gettitre return titre public String getauteur return auteur public int getprix return prix public void settitre String titre this titre titre public voi
Devoir java Exercie et public class book String titre String auteur int prix public String gettitre return titre public String getauteur return auteur public int getprix return prix public void settitre String titre this titre titre public void setauteur String auteur this auteur auteur public void setprix int prix this prix prix public static void main String args book b new book b settitre les meserables b setauteur vector hergo b setprix CSystem out println b gettitre n b getauteur n b getprix - public class book String titre String auteur int prix public book String titre String auteur int prix this titre titre this auteur auteur this prix prix public static void main String args book b new book LE PRINCE NOUHAILA CHARAF book b new book LA POMME VECTOR HEGOF public class book String titre String auteur int prix public book String titre String auteur int prix this titre titre this auteur auteur this prix prix public void a ?che System out println titre n auteur n prix public static void main String args book b new book LE PRINCE NOUHAILA CHARAF book b new book LA POMME VECTOR HEGOF b a ?che b a ?che public class test public static void main String args Cbook livres new book Scanner sc null Object book for int i i livres length i sc new Scanner System in System out print Donner le titre du livre n i String titre sc nextLine System out print Donner l'auteur du livre n i String auteur sc nextLine System out print Donner le prix du livre n i int prix sc nextInt book i new book titre auteur prix sc close for book l book System out println l System out println Le nombre de livres est book count Exercice package employe import java util Scanner public class employe String matricule nom prenom long AnneNaiss AnneEmbauche int salaire public String getmatricule return matricule public String getnom return nom public String getprenom return prenom public long getAnneNaiss return AnneNaiss public long getAnneEmbauche return AnneEmbauche public int getsalaire return salaire public void setmatricule String matricule C this matricule matricule public void setnom String nom this nom nom public void setprenom String prenom this prenom prenom public void setAnneNaiss long AnneNaiss this AnneNaiss AnneNaiss public void setAnneEmbauche long AnneEmbauche this AnneEmbauche AnneEmbauche public void setsalaire int salaire this salaire salaire public static void main String args employe E new employe E setmatricule dacias E setnom chacha E setprenom ahmed E setAnneNaiss E setAnneEmbauche E setsalaire System out println les information de l'employe est n System out println E getmatricule n E getnom n E getprenom n E getAnneNaiss n E getAnneEmbauche n E getsalaire package employe import java util Scanner public class employe String matricule nom prenom long AnneNaiss AnneEmbauche int age Anciennete salaire nvsalaire public int getage return age public int getAnciennete Creturn Anciennete public void AugmentationDuSalaire int Anciennete if Anciennete nvsalaire int salaire salaire System out println le nv salaire est nvsalaire else if
Documents similaires










-
37
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Aucune attribution requise- Détails
- Publié le Jui 13, 2021
- Catégorie Literature / Litté...
- Langue French
- Taille du fichier 36.4kB