{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

mylecture07

# mylecture07 - CS107 Computing for Math and Science Click to...

This preview shows pages 1–13. Sign up to view the full content.

CS107, Prof. Steinberg, S10 1 Lecture 07 Click to edit Master subtitle style CS107: Computing for Math and Science Lecture 07: Loops

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS107, Prof. Steinberg, S10 2 Lecture 07 Boolean Vectors Result of [2 3 4] + 3 is [5 6 7] 2 > 3 is an operation like 2 + 3 Result of [2 3 4] > 3 is [0 0 1]
CS107, Prof. Steinberg, S10 3 Lecture 07 Boolean Vectors a = [10 33 32 19 5] b = a > 20 0 1 1 0 0 find(b) 2 3 a(b) 33 32 a(b) = 20 a becomes 10 20 20 19 5 c = [0 1 0 1] a( c ) error

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS107, Prof. Steinberg, S10 4 Lecture 07 Input To read data from the keyboard input(‘next score? ‘) A prompt is printed by the computer to let the user know the computer is waiting for input. prompt
CS107, Prof. Steinberg, S10 5 Lecture 07 Input The data typed is returned as the value of the call to input. x = input(‘x coordinate: ‘);

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS107, Prof. Steinberg, S10 6 Lecture 07 Input vs Argument Input Function argument Data come from The user The program When At any time When the call starts
CS107, Prof. Steinberg, S10 7 Lecture 07 Input vs Argument

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS107, Prof. Steinberg, S10 8 Lecture 07 Output vs Result Output Function result Data goes to The user The program When At any time When the call ends
CS107, Prof. Steinberg, S10 9 Lecture 07 Output vs Result

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS107, Prof. Steinberg, S10 10 Lecture 07 The Command Window
CS107, Prof. Steinberg, S10 11 Lecture 07 The Command Window

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 33

mylecture07 - CS107 Computing for Math and Science Click to...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online