Epi-Pdo

Lab 8_6 Stall class

Dec 12th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package lab8_6;
  7.  
  8. /**
  9.  *
  10.  * @author alang
  11.  */
  12. public class Stall {
  13.     private String id;
  14.     private int burgersold;
  15.     private static int totalburgersold=0;
  16.    
  17.    
  18.    Stall(String id){
  19.      burgersold=0;
  20.      this.id=id;
  21.    }
  22.      
  23.    public void Sold(int burger){
  24.        burgersold=burger;
  25.        totalburgersold+=burger;
  26.    }
  27.    
  28.    public void display(){
  29.        System.out.println("Burger Stall- "+id);
  30.        System.out.println("total burger sold today is "+burgersold);
  31.        
  32.    }
  33.    public void displayAll(){
  34.        System.out.println("The total number of burger sold from all stalls is "+totalburgersold);
  35.    }
  36.  
  37.  
  38.  
  39.    
  40.    }
Add Comment
Please, Sign In to add comment