#include<iostream.h>

#include <conio.h>

#include<iomanip.h>

void calculate(double &y, double x);

main()

{

clrscr();

double y,x=0.00;

int ch=0;

```
do
{
cin>>y;
if (y<=2000.00)
{
do
{
cin>>x;
double z=x;
if(((int)z%5==0)&&(y>x+0.50))
{
calculate(y,x);
}
else if(x>=y+0.50)
{
cout<<"Invalid";
x=0.00;
}
else
{
cout<<"Try again:";
x=0.00;
}
}
while(x==0.00);
}
else
{
cout<<"Invalid!";
ch=1;
}
}
while (ch==1);
getch();
return 0;
}
void calculate(double &y, double x)
{
y=y-x-0.50;
cout<<"
```

Your current balance is: "<<setprecision(2)<<y;

}