Question: Where's the bug? 1 . bool withdraw ( double val ) { 2 . lock ( ) ; 3 . if ( account _ value

Where's the bug?
1. bool withdraw(double val){
2. lock();
3. if(account_value >= val){
4. account_value -= val;
5. unlock();
6. return true;
7.}
8. return false;
9.}
No bug
Line 2
Between lines 2-3
Line 3
Between lines 3-4
Line 4
Between lines 4-5
Line 5
Between lines 5-6
Line 6
Between lines 6-7
Line 7
Between lines 7-8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!