Answer:
The code is written in C++:
- #include <iostream>
- using namespace std;
- int main()
- {
- double cost = 88.67;
- double tax = 88.67 * 0.0675;
- double tip = 0.2 * cost * tax;
- double total = cost + tax + tip;
-
- cout<< "The total bill is $" << total;
- return 0;
- }
Step-by-step explanation:
Firstly, let's declare and initialize the variable cost (Line 7). We just assign 88.67 cost value as given in the question.
Next, we declare variable tax, tip and total and apply the calculation formula to work out the value for each variable (Line 8-9).
At last, display the total to the console terminal (Line 12).