Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. package fr.llm.TP_Heritage.model;
  2.  
  3. import java.util.ArrayList;
  4. import fr.llm.TP_Heritage.model.BookExo1;
  5.  
  6.  
  7. public class BookStoreExo1 {
  8.  
  9. private ArrayList<BookExo1> maListeBookExo1;
  10.  
  11. public BookStoreExo1() {
  12. this.maListeBookExo1 = new ArrayList<BookExo1>();
  13. }
  14.  
  15.  
  16. public void addBook(int rfidInit, String auteurInit, String titreInit, String dateAchatInit, double prixAchatInit) {
  17. maListeBookExo1.add(new BookExo1(rfidInit, auteurInit, titreInit, dateAchatInit, prixAchatInit));
  18. }
  19.  
  20. public void displayBook() {
  21. System.out.println(maListeBookExo1.size());
  22. int i;
  23. for(i=0; i<maListeBookExo1.size(); i++) {
  24. System.out.println(maListeBookExo1.get(i));
  25. }
  26. }
  27.  
  28. public void findIndex() {
  29. int j;
  30. int max=0;
  31. for(j=0; j<maListeBookExo1.size(); j++) {
  32. if (maListeBookExo1.get(j).getRfid() > max) {
  33. max = maListeBookExo1.get(j).getRfid();
  34. }
  35. }
  36. System.out.println("Le plus grand tag rfid est : " + max);
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement