Answer:
# include<iostream>
#include<conio.h>
using namespace std;
main()
{
float subtotal, gratuityrate, total, gratuity;
cout<<"enter the value of subtotal amount = ";
cin>>subtotal;
cout<<"/nPercentage gratuity rate = ";
cin>>gratuityrate;
gratuity = gratuity / subtotal;
total = gratuity + subtotal;
Cout<<"/nGratuity = "<< gratuity;
Cout<<"/nTotal = "<<total;
getch();
}
Explanation:
In this program, four variable has been taken in float datatype variables to enter or calculate values in decimal. Then take two user defined values gratuity rate and subtotal. By using formula, calculate the gratuity and total amount.