Ask Question
17 January, 12:55

Write a program that computes the tax and tip on a restaurant bill for a patron a $88.67 meal charge. The tax should be 6.75 percent of the meal cost. The tip should be 20 percent of the total after adding the tax. Display the meal cost, tax amount, tip mount, and total bill on the screen.

+3
Answers (1)
  1. 17 January, 15:23
    0
    C+ + code is writtern below with explanation in comments

    Explanation:

    #include

    using namespace std;

    int main ()

    {

    //declare all the required fields in double format

    double mealCost = 88.67;

    double taxPercenatage=6.75;

    double tipPercentage=20;

    / / displaying the original Meal Cost

    cout<< "Meal Cost: "<
    / / get the total tax percentage from meal cost

    double totalTax = taxPercenatage / 100 * mealCost;

    / / display the tax amount

    cout<< "Tax Amount: "<
    / / getting tip amount from meal cost and tax amount.

    double totalTip = tipPercentage/100 * (mealCost+totalTax);

    //displaying tip amount

    cout<< "Tip Amount: "<
    / / now adding all three values and get total amount that customer

    / / has to pay

    double totalAmount = mealCost+totalTax+totalTip;

    //Displaying total amount

    cout<< "Total Bill: "<
    return 0;

    }

    Output

    Meal Cost: 88.67

    Tax Amount: 5.98523

    Tip Amount: 18.931

    Total Bill: 113.586
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a program that computes the tax and tip on a restaurant bill for a patron a $88.67 meal charge. The tax should be 6.75 percent of the ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers