#include
#include
#include<math.h>
using namespace std;
bool check(int x)
{
if(x%5==0)
return true;
else
return false;
}
float withdraw(float balance, int amt)
{
return (balance-amt-.50);
}
int main()
{ int amount;
float balance;
cout<<“enter the balance and amount to withdraw”;
cin>>amount>>balance;
cout.setf(ios::fixed);
if(amount>0 && amount <= 2000 && balance>0 && balance<=2000)
{
if(balance>amount)
{
if(check(amount))
{
cout<<setprecision(2)<<withdraw(balance,amount);
}
else
cout<<setprecision(2)<< balance;
}
else
cout<<setprecision(2)<<balance;
}
return 0;
}