Lecture overview -- Keyboard shortcut: 'u'  Previous page: Loop Invariants [Section] -- Keyboard shortcut: 'p'    Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Page 32 : 32
Object-oriented Programming in C#
Contracts and Assertions
Loop Invariants

Invariants are not limited to classes

Loop invariants are the primary means to control and reason about loops

/user/normark/oop-csharp-1/sources/c-sharp/loop-invariants/1/div.csDivision by repeated subtraction.


/user/normark/oop-csharp-1/sources/c-sharp/loop-invariants/1/div-outputOutput of the division program.


/user/normark/oop-csharp-1/sources/c-sharp/loop-invariants/1/instrumented-div.csDivision by repeated subtraction - instrumented with output inside loop.


/user/normark/oop-csharp-1/sources/c-sharp/loop-invariants/1/instrumented-div-outputOutput of the instrumented division program.