SUNY Geneseo Department of Computer Science


“If” Statements, Day 1

Friday, March 28

CSci 120, Spring 2014
Prof. Doug Baldwin

Return to List of Lectures

Previous Lecture

Misc

Web server back, let me know of any problems

Project 2: Comments matter!

Questions?

Quiz 5

Solutions

        >> x = 7;
        if x > 1
        fprintf( 'Hello\n' )
        else
        fprintf( 'Goodbye\n' )
        end
        Hello
        >> if x > 10
        fprintf( 'Yes\n' )
        elseif x > 5
        fprintf( 'Maybe\n' )
        else
        fprintf( 'No\n' )
        end
        Maybe

Discontinuous function greater than 0 at x=0 and x=1

“If” Statements

Demo

Concentric circles with dot on outer one slightly counterclockwise of dot on inner

Two vagukey sinusoidal curves

See handout for lesson details


Next Lecture