templetiggerxyz
05.10.2019 •
Computers and Technology
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.
Solved
Show answers
More tips
- S Sport Playing Bowling: Rules and Advice for Novices...
- C Computers and Internet How to Properly Repartition a Hard Drive?...
- A Auto and Moto What Is the Cost of Customs Clearance for a Car in Russia?...
- L Leisure and Entertainment Should You Buy a Ceramic Knife?...
- C Computers and Internet How to easily and quickly disable Firebug in Gmail and Google Docs...
- G Goods and services How to sew a ribbon: Tips for beginners...
- F Food and Cooking How to Make Mayonnaise at Home? Secrets of Homemade Mayonnaise...
- C Computers and Internet Which Phone is Best for Internet Surfing?...
- F Food and Cooking Everything You Need to Know About Pasta...
- C Computers and Internet How to Choose a Monitor?...
Answers on questions: Computers and Technology
- M Mathematics Afood company distributes its tomato soup in two cans of different sizes. for the larger can, both the diameter and the height have been increased by 20% . by what...
- S Social Studies Elementary school children who separate and tend to play in groups of their own gender are demonstrating the stage of psychosexual development....
- M Mathematics Help please !! I don’t understand this...
- B Biology In peas the flower color and pollen length genes are very close together on the same chromosome. Purple flowers (P are dominant to white (p), and long pollen (L)...
Ответ:
C++ code is writtern below with explanation in comments
Explanation:
#include <iostream>
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: "<<mealCost<<endl;
// get the total tax percentage from meal cost
double totalTax= taxPercenatage /100 * mealCost;
// display the tax amount
cout<< "Tax Amount: "<<totalTax<<endl;
// getting tip amount from meal cost and tax amount.
double totalTip = tipPercentage/100 * (mealCost+totalTax);
//displaying tip amount
cout<< "Tip Amount: "<<totalTip<<endl;
// 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: "<<totalAmount<<endl;
return 0;
}
Output
Meal Cost: 88.67
Tax Amount: 5.98523
Tip Amount: 18.931
Total Bill: 113.586
Ответ: