File tree 1 file changed +4
-2
lines changed
14_file_handling/10_bank_account
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,8 @@ void showPersonsHavingBalGreater(double balanceLimit)
226
226
// // specify file name
227
227
const char *fileName = " bank_data.dat" ;
228
228
229
- int found = 0 ;
229
+ // // found any person having balance greater than given balance
230
+ int found = false ;
230
231
231
232
// create an instance of ifstream for reading from a file
232
233
ifstream fin;
@@ -256,7 +257,7 @@ void showPersonsHavingBalGreater(double balanceLimit)
256
257
// // display data
257
258
tempBankAccount.showBankAccountData ();
258
259
cout << endl;
259
- found = 1 ;
260
+ found = true ;
260
261
}
261
262
262
263
// // read one record
@@ -266,6 +267,7 @@ void showPersonsHavingBalGreater(double balanceLimit)
266
267
// // close file
267
268
fin.close ();
268
269
270
+ // // if there is no person having balance greater than given balance
269
271
if (!found)
270
272
{
271
273
cout << " \n There is No Person Having Balance Greater than " << balanceLimit << endl;
You can’t perform that action at this time.
0 commit comments