You operate several hot dog stands distributed throughout


Question: You operate several hot dog stands distributed throughout town. Define a class named Hot Dog Stand that has an instance variable for the hot dog stand's ID number and an instance variable for how many hot dogs the stand has sold that day. Create a constructor that allows a user of the class to initialize both values. Also create a method named just Sold that increments by one the number of hot dogs the stand has sold. The idea is that this method will be invoked each time the stand sells a hot dog so that you can track the total number of hot dogs sold by the stand. Add another method that returns the number of hot dogs sold. Finally, add a static variable that tracks the total number of hot dogs sold by all hot dog stands and a static method that returns the value in this variable. Write a main method to test your class with at least three hot dog stands that each sell a variety of hot dogs.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: You operate several hot dog stands distributed throughout
Reference No:- TGS02404512

Now Priced at $15 (50% Discount)

Recommended (90%)

Rated (4.3/5)