Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Pizza;
- import java.util.Scanner;
- public class Pizza {
- Scanner tastiera = new Scanner(System.in);
- private String nome;
- private double prezzo;
- private boolean venduta;
- public Pizza(){
- nome = "nome";
- prezzo = 0.0;
- venduta = false;
- }
- public Pizza(String nome, Double prezzo, Boolean venduta){
- setNome(nome);
- setPrezzo(prezzo);
- setVenduta(venduta);
- }
- public String getNome() {
- return nome;
- }
- public void setNome(String nome) {
- this.nome = nome;
- }
- public double getPrezzo() {
- return prezzo;
- }
- public void setPrezzo(double prezzo) {
- this.prezzo = prezzo;
- }
- public boolean getVenduta() {
- return venduta;
- }
- public void setVenduta(boolean venduta) {
- this.venduta = venduta;
- }
- public String toString(){
- return "nome: " + nome + "/nprezzo: " + prezzo;
- }
- public void inserimento(){
- System.out.print("inserisci la pizza:");
- nome = tastiera.nextLine();
- System.out.print("inserisci il prezzo:");
- prezzo = tastiera.nextDouble();
- }
- public void insOrdine(){
- System.out.print("inserisci la pizza:");
- nome = tastiera.nextLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement