Ask Question
9 February, 02:56

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.

+5
Answers (1)
  1. 9 February, 03:34
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers