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.

Image

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

Image

smithdowen1979.blogspot.com

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

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel