Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dedication of Duty.

Similar presentations


Presentation on theme: "Dedication of Duty."— Presentation transcript:

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


Download ppt "Dedication of Duty."

Similar presentations


Ads by Google