Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class HotDogStand
- {
- private static int totalSold = 0;
- public static int getTotalSold()
- {
- return totalSold;
- }
- private String name;
- private int id;
- private int numSold;
- public HotDogStand(String name, int id)
- {
- this.name = name;
- this.id = id;
- }
- public void justSold()
- {
- numSold++;
- totalSold++;
- }
- public int getNumSoldToday()
- {
- return numSold;
- }
- public int getID()
- {
- return id;
- }
- public String getName()
- {
- return name;
- }
- public String toString()
- {
- return name+" ("+id+") - "+numSold;
- }
- public HotDogStand(HotDogStand rhs)
- {
- id = rhs.id;
- name = ""+rhs.name;
- numSold = rhs.numSold;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement