Answers for "c++ program to calculate discount"

C++
0

c++ program to calculate discount

/*no:Departmental store offers 2.5% discount on shopping of 20,000
and more Rs. 1.5% discount on shopping of 5000 Rs and more.
and no discount on shopping of less than 5000Rs to those customer who have
membership cards. Design a program that accepts total bill
of buyer and membership card(Y/N) as input and calculates amount to be paid after
applying discount?*/

#include<iostream>
using namespace std;
int main()
{
	float a;
	char b;
	cout<<"Enter a Total bill=";
	cin>>a;
	cout<<"Do you a Membership card=";
	cin>>b;
	if(a>=2000&&b=='y')
	{
		cout<<a-(a*2.5/100);
	}
	else if(a>=5000&&b=='y')
		{
			cout<<a-(a*1.5/100);
		}
	else
	cout<<a;
}
Posted by: Guest on March-17-2022

Code answers related to "c++ program to calculate discount"

Browse Popular Code Answers by Language