Skip to content

Commit 46063ea

Browse files
committed
add: cpp-programming-questions 14_file_handling 10
1 parent 2b237ca commit 46063ea

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: 14_file_handling/10_bank_account/10_bank_account.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ void showPersonsHavingBalGreater(double balanceLimit)
226226
// // specify file name
227227
const char *fileName = "bank_data.dat";
228228

229-
int found = 0;
229+
// // found any person having balance greater than given balance
230+
int found = false;
230231

231232
// create an instance of ifstream for reading from a file
232233
ifstream fin;
@@ -256,7 +257,7 @@ void showPersonsHavingBalGreater(double balanceLimit)
256257
// // display data
257258
tempBankAccount.showBankAccountData();
258259
cout << endl;
259-
found = 1;
260+
found = true;
260261
}
261262

262263
// // read one record
@@ -266,6 +267,7 @@ void showPersonsHavingBalGreater(double balanceLimit)
266267
// // close file
267268
fin.close();
268269

270+
// // if there is no person having balance greater than given balance
269271
if (!found)
270272
{
271273
cout << "\nThere is No Person Having Balance Greater than " << balanceLimit << endl;

0 commit comments

Comments
 (0)