Write a Program That Reads the Subtotal and the Gratuity Rate
Write a program that reads the subtotal and the gratuity rate, then computes the gratuity and full. For example, if the user enters 10 for subtotal and 15% for gratuity charge per unit, the program displays $ane.five every bit gratuity and $11.5 as full.
(Financial application: summate tips) Write a program that reads the subtotal and
the gratuity rate, so computes the gratuity and total. For example, if the user enters
10 for subtotal and 15% for gratuity rate, the programme displays $i.v as gratuity
and
$eleven.5 equally full.
#Beginner
In gcc c++ compiler using namespace std;
#include<iostream>
using namespace std;
int primary()
{
float total , gratuity_rate ;
cout<<" enter sub total and gratuity rate :";
cin>>total>>gratuity_rate;
float gratuity = full*gratuity_rate/100;
float final_total = gratuity + full;
cout<<"gratuity $"<<gratuity<<" concluding full is $"<<final_total;
return 0;
}
Output
enter sub total and gratuity charge per unit :10 15
gratuity $one.five concluding full is $eleven.5
[Programme finished]
Popular posts from this weblog
Write a programme that calculates the energy needed to heat water from an initial temperature to a final temperature. Your programme should prompt the user to enter the corporeality of water in kilograms and the initial and final temperatures of the h2o.
(Science:computing free energy ) Write a program that calculates the free energy needed to heat water from an initial temperature to a final temperature. Your plan should prompt the user to enter the amount of water in kilograms and the initial and final temperatures of the water. The formula to compute the energy is Q = Thou * (finalTemperature – initialTemperature) * 4184 where Yard is the weight of water in kilograms, temperatures are in degrees Celsius, and energy Q is measured in joules. #Beginner In gcc c++ compiler using namespace std; #include<iostream> using namespace std; int primary() { bladder M,finalTemperature,initialTemperature; cout<< "Enter te amount of water in kilograms :" ; cin>>G; cout<< "Enter the initial temperature :" ; cin>>initialTemperature; cout<< "Enter te finalTemperature :" ; cin>>finalTemperature; float Q=Grand*(finalTemperature-initialTemperature)*4184; cout<< "Th
Write a program that prompts the user to enter the min- utes (e.g., i billion), and displays the number of years and days for the minutes. For simplicity, assume a year has 365 days
(Notice the number of years) Write a program that prompts the user to enter the min- utes (due east.g., one billion), and displays the number of years and days for the minutes. For simplicity, presume a year has 365 days. #Beginner In gcc c++ compiler using namespace std; #include<iostream> using namespace std; int main() { int minutes; cout<< "enter the minutes : " ; cin>>minutes; const int year_per_minutes=365*24*sixty; const int day_per_minutes=24*60; int year=minutes/year_per_minutes; int day=(minutes%year_per_minutes)/(day_per_minutes); cout<< " " <<minutes<< " minutes is aproximately " <<twelvemonth<< " years and " <<twenty-four hours<< " days" ; return 0; } re-create Output enter the minutes : 1000000000 1000000000 minutes is aproximately 1902 years and 214 days [Program finished] Need of Programmer Need of Programmer
Source: https://codeforprogrammingpro.blogspot.com/2021/01/write-program-that-reads-subtotal-and.html
0 Response to "Write a Program That Reads the Subtotal and the Gratuity Rate"
Post a Comment