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

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

View Full Document Right Arrow Icon
CS107, Prof. Steinberg, S10 1 Lecture 07 Click to edit Master subtitle style CS107: Computing for Math and Science Lecture 07: Loops
Background image of page 1

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

View Full DocumentRight Arrow Icon
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]
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 4
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: ‘);
Background image of page 5

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

View Full DocumentRight Arrow Icon
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
Background image of page 6
CS107, Prof. Steinberg, S10 7 Lecture 07 Input vs Argument
Background image of page 7

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

View Full DocumentRight Arrow Icon
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
Background image of page 8
CS107, Prof. Steinberg, S10 9 Lecture 07 Output vs Result
Background image of page 9

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

View Full DocumentRight Arrow Icon
CS107, Prof. Steinberg, S10 10 Lecture 07 The Command Window
Background image of page 10
CS107, Prof. Steinberg, S10 11 Lecture 07 The Command Window
Background image of page 11

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

View Full DocumentRight Arrow Icon
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 33

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

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online