questiondesign a tips class that calculates the


Question

Design a Tips class that calculates the gratuity on a restaurant meal. Its only class member variable, taxRate, has to be set by a one-parameter constructor to anything rate is passed to it as a Tips object is created. If no argument is passed, a default tax rate of .065 must be used. The class must have just one public function, computeTip. These function requirements to accept two arguments, total bill amount and the tip rate. It has to use this information to compute meal cost before any tax was added. It should then apply tip rate to just the meal cost portion of the bill to compute and return the tip amount.

Show class by creating a program that creates a single Tips object, after that loops multiple times to allow program user to retrieve the correct tip amount using various bill totals and desired tip rates.

Input Validation- If a tax rate of less than 0 is passed to the constructor; use default rate of .065. Do not allocate the total bill or the tip rate to be less than 0.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: questiondesign a tips class that calculates the
Reference No:- TGS0445010

Expected delivery within 24 Hours