#include
#include
#include
using namespace std;
double withDraw(double x,double total){
if((int)x%5 == 0 && total > x){
double temp = total;
temp -= x;
temp -= 0.50;
cout << setprecision(2) << fixed;
return temp;
}
else if ((int)x%5 == 0 && total < x){
cout << "insufficient funds in account:\n" << endl;
cout << "total account balance :\n" << total;
}
else {
cout << "enter valid number:\n";
cout << "total account balance: \n" << total << endl;
}
}
int main (){
double with;
double total;
cout <<“enter total amount\n”;
cin >> total;
cout << "please enter withdrawal amout\n";
cin >> with;
cout << setprecision(2) ;
cout << withDraw(with,total) << endl;
return 0;
}