Advertisement
albezzzzz

Untitled

May 26th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. package Pizza;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Pizza {
  6.  
  7. Scanner tastiera = new Scanner(System.in);
  8.  
  9. private String nome;
  10. private double prezzo;
  11. private boolean venduta;
  12.  
  13. public Pizza(){
  14. nome = "nome";
  15. prezzo = 0.0;
  16. venduta = false;
  17. }
  18.  
  19. public Pizza(String nome, Double prezzo, Boolean venduta){
  20. setNome(nome);
  21. setPrezzo(prezzo);
  22. setVenduta(venduta);
  23. }
  24.  
  25. public String getNome() {
  26. return nome;
  27. }
  28.  
  29. public void setNome(String nome) {
  30. this.nome = nome;
  31. }
  32.  
  33. public double getPrezzo() {
  34. return prezzo;
  35. }
  36.  
  37. public void setPrezzo(double prezzo) {
  38. this.prezzo = prezzo;
  39. }
  40.  
  41. public boolean getVenduta() {
  42. return venduta;
  43. }
  44.  
  45. public void setVenduta(boolean venduta) {
  46. this.venduta = venduta;
  47. }
  48.  
  49. public String toString(){
  50. return "nome: " + nome + "/nprezzo: " + prezzo;
  51. }
  52.  
  53. public void inserimento(){
  54. System.out.print("inserisci la pizza:");
  55. nome = tastiera.nextLine();
  56. System.out.print("inserisci il prezzo:");
  57. prezzo = tastiera.nextDouble();
  58. }
  59.  
  60. public void insOrdine(){
  61. System.out.print("inserisci la pizza:");
  62. nome = tastiera.nextLine();
  63. }
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement