Download presentation
Presentation is loading. Please wait.
1
Dedication of Duty
2
Important! Every function should have a singular task to perform and no more.
3
Examples if (x >= 0) root = square_root(x);
do { cout<<"enter nonnegative number: "<<endl; cin>>num; } while (num < 0); root = square_root(num); if ( f(x) < 0 ) exit (1); root = square_root(f(x));
4
Examples if (x >= 0) root = square_root(x);
do { cout<<"enter nonnegative number: "<<endl; cin>>num; } while (num < 0); root = square_root(num); if ( f(x) < 0 ) exit (1); root = square_root(f(x));
5
Examples if (x >= 0) root = square_root(x);
do { cout<<"enter nonnegative number: "<<endl; cin>>num; } while (num < 0); root = square_root(num); if ( f(x) < 0 ) exit (1); root = square_root(f(x));
6
End of Session
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.