Menu Close

Find out the tax amount of the bill with tip for the meal.

Aaron took his girl friend Binita to a restauraunt as he got a job of his dreams. Since he had small welcome interview he was little bit tennsed. Binita figured this out and to get back Aaron’s confidence she gave him a little task,
When they received the bill for the food they ordered,she asked aaron to find out the tax amount of the bill and tip for the meal through a computer code. 

Aaron can use your local tax rate when computing the amount of tax owing. Can you help aaron to code the suitable logic.
Note:

Local tax= 18%
Tip amount=5%

Input:
Input has integer representing the Bill Amount.

Output:
In First Line Print the calculated Tax with 2 values after decimal point.

In Second Line Print the calculated Tip with 2 values after decimal point.

In the Third Line Print the Total Bill Amount with tax and tip with 2 values after decimal point.
#include <stdio.h>
int main()
{
int billwt;
float tax,tip,totaltax,totaltip,totalbill;
scanf("%d",&billwt);
tax=0.18;
tip=0.05;
totaltax=tax*billwt;
totaltip=tip*billwt;
totalbill=billwt+totaltax+totaltip;
printf("The Tax is %.2f\nThe Tip is %.2f",totaltax,totaltip);
printf("\nTotal Bill With Tax and Tip is %.2f",totalbill);return 0;
}

INPUT_1:
524

OUTPUT:
The Tax is 94.32
The Tip is 26.20
Total Bill With Tax and Tip is 644.52


INPUT_2:
734

OUTPUT:
The Tax is 132.12
The Tip is 36.70
Total Bill With Tax and Tip is 902.82


INPUT_3:
800

OUTPUT:
The Tax is 144.00
The Tip is 40.00
Total Bill With Tax and Tip is 984.00


INPUT_4:
10000

OUTPUT:
The Tax is 1800.00
The Tip is 500.00
Total Bill With Tax and Tip is 12300.00



Morae Q!