Design a Tips class that calculates the gratuity on a restaurant meal Design a Tips class that calculates the gratuity on a restaurant meal.
  
  Its only class member variable, taxRate, should be set by a
  one-parameter constructor to whatever rate is passed to it when a Tips
  object is created. If no argument is passed, a default tax rate of
  .065 should be used.
  
  The class should have just one public function, computeTip. This
  function needs to accept two arguments, the total bill amount and the
  tip rate. It should use this information to compute what the cost of
  the meal was before the tax was added. It should then apply the tip
  rate to just the meal cost portion of the bill to compute and return
  the tip amount.
  
  Demonstrate the class by creating a program that creates a single Tips
  object, and then allows the program user to retrieve the correct tip
  amount using various bill totals and desired tip rates.


What can I do better?

#include&lt;iostream&gt;
#include &lt;string&gt;

using namespace std;

class Tips
{
       private :
           double taxRate;

       public:
          Tips()
          {
                taxRate = .65;
                cout &lt;&lt; "Tax rate is "&lt;&lt;taxRate&lt;&lt;endl;
          }

          Tips(double tax)
          {
                     taxRate = tax;
                     cout &lt;&lt; "Tax rate is"&lt;&lt;taxRate&lt;&lt;endl;
          }

          double computeTip(double billAmount,double tipRate)
          {
                double mealCost = billAmount - billAmount*(taxRate);

                cout &lt;&lt; "Meal cost is with no tax "&lt;&lt;mealCost&lt;&lt;endl;
                return mealCost+tipRate;
          }
};

int main()
{
    Tips tip ;
    cout &lt;&lt; "Meal cost + tip rate is "&lt;&lt;tip.computeTip(100,20)&lt;&lt;endl;

    return 0;
}
Inconsistant layout:

#include&lt;iostream&gt;   // No space
#include &lt;string&gt;    // Space


Be consistent in your code. I prefer the version with the space.

Using namespace std

Arrrrr. Don't do that. see: Why is “using namespace std;” considered bad practice?.

Definately never do it in a header file. You are pulliting the namesapce for anybody that includes your code (which can change behavior) and break other peoples code. Don't do it in source files because of the reasons you read in the linked article.

Default argument

      Tips()
      {
            taxRate = .65;
            cout &lt;&lt; "Tax rate is "&lt;&lt;taxRate&lt;&lt;endl;
      }

      Tips(double tax)
      {
                 taxRate = tax;
                 cout &lt;&lt; "Tax rate is"&lt;&lt;taxRate&lt;&lt;endl;
      }


When you see code like this you can usually replace it with a single constructor that has a parameter with a default argument (as they are basically doing the same thing).

      Tips(double tax = 0.065) // Corrected you constant.
      {
           taxRate = tax;
           cout &lt;&lt; "Tax rate is"&lt;&lt;taxRate&lt;&lt;endl;
      }


Be consistent with spacing (white space is your friend)

           cout &lt;&lt; "Tax rate is"&lt;&lt;taxRate&lt;&lt;endl;
                ///            ^^^^^^  ^^^^^        Looking very tight here.

           cout &lt;&lt; "Meal cost + tip rate is "&lt;&lt;tip.computeTip(100,20)&lt;&lt;endl;
                ////                        ^^^^^                   ^^^^


Prefer '\n' over std::endl

std::end forces a flush of the stream. This is never what you actually want. The automated flushing of the stream will work much better than manual flushing.

Prefer to use the initializer list.

      Tips(double tax = 0.065) // Corrected you constant.
           :   taxRate(tax)
      {
           cout &lt;&lt; "Tax rate is"&lt;&lt; taxRate &lt;&lt; endl;
      }


Arithmetic issue

If the billAmount is mealCost * (1 + taxRate) then this is not the formula to calculate meal cost.

            double mealCost = billAmount - billAmount*(taxRate);