51 lines
1.6 KiB
Java
51 lines
1.6 KiB
Java
/*
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|
*/
|
|
|
|
package com.mycompany.bibliotheque;
|
|
|
|
/**
|
|
* Classe principale
|
|
* @author dthev
|
|
*/
|
|
|
|
|
|
import com.mycompany.bibliotheque.Metier.Bibliotheque;
|
|
import com.mycompany.bibliotheque.Metier.Emprunt;
|
|
import com.mycompany.bibliotheque.Metier.Utilisateur;
|
|
import com.mycompany.bibliotheque.Metier.Livre;
|
|
import java.util.Scanner;
|
|
|
|
public class GestionBibliotheque {
|
|
public static void main(String[] args) {
|
|
Scanner sc = new Scanner(System.in);
|
|
int choix=0;
|
|
Bibliotheque laBibli = new Bibliotheque();
|
|
Livre l1 = new Livre("Le secret des secrets","Dan Brown","9782709668385",true);
|
|
Utilisateur u1 = new Utilisateur("Alice");
|
|
|
|
System.out.println("Bienvenue dans la bibliothèque !");
|
|
while (choix!=4){
|
|
System.out.println("1. Afficher un livre");
|
|
System.out.println("2. Ajouter un livre");
|
|
System.out.println("3. Afficher les livres");
|
|
System.out.println("4. Quitter");
|
|
System.out.print("Merci de faire votre choix : ");
|
|
choix = sc.nextInt();
|
|
switch (choix) {
|
|
case 1 :
|
|
System.out.println("---Livre : " + l1.getTitre());
|
|
break;
|
|
case 2 :
|
|
laBibli.addLivre(l1);
|
|
break;
|
|
case 3 :
|
|
for (Livre leLivre : laBibli.getLesLivres()) {
|
|
System.out.println("---"+leLivre.toString());
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|