Question #188725

  1. Write a class definition for an Order class for a nightclub that contains table number, a server’s name, and the number of patrons at the table. Include a private static data member for the table minimum charge, which is $4.75. Write a main() function that declares no Order objects but that uses a static member function to display the table minimum charge.

Expert's answer

class Order
{
     int tableNumber;
     string serverName;
     int numberOfPatrons;
     static float minCharge = 4.75;
 public:
      static void displayMinCharge()
      {
            cout << "Minimal charge is " << minCharge;
      }
}

int main()
{
      displayMinCharge();
      return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS