Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. public void scegliEsame(Medico m)
  2. {
  3. Scanner scan=new Scanner(System.in);
  4. String nome, data;
  5.  
  6. System.out.print("Inserire numero di esami da prenotare: ");
  7. int ex=scan.nextInt();
  8. System.out.println();
  9. scan.nextLine();
  10. for(int i=0;i<ex;i++)
  11. {
  12. System.out.print("Inserire nome esame da voler effettuare: ");
  13. nome=scan.nextLine();
  14.  
  15. if(m.getCosto(nome)==-1)
  16. {
  17. System.out.println("Esame non trovato");
  18. return;
  19. }
  20. else
  21. costo+=m.getCosto(nome);
  22.  
  23.  
  24. System.out.print("Inserire data di prenotazione: ");
  25. data=scan.nextLine();
  26. Esame e=new Esame(nome, m, data,costo);
  27. esami.add(e);
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement