CS 102 Computers In Context (Multimedia)‏ 03 / 25 / 2009 Instructor: Michael Eckmann.

Slides:



Advertisements
Similar presentations
CS 206 Introduction to Computer Science II 09 / 05 / 2008 Instructor: Michael Eckmann.
Advertisements

Computer Science 101 While Statement. Iteration: The While-Statement The syntax for the While- Statement is while : The syntax for the While- Statement.
CS 102 Computers In Context (Multimedia)‏ 04 / 13 / 2009 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 04 / 01 / 2009 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 01 / 29 / 2007 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 01 / 20 / 2009 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 10 / 22 / 2008 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 02 / 06 / 2009 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 03 / 20 / 2009 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 04 / 08 / 2009 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 02 / 18 / 2009 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 09 / 14 / 2009 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 09 / 09 / 2009 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 04 / 20 / 2009 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 02 / 04 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 01 / 21 / 2009 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 01 / 30 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 02 / 06 / 2009 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 04 / 01 / 2009 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 01 / 29 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 10 / 20 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 09 / 04 / 2008 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 02 / 02 / 2009 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 02 / 12 / 2007 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 09 / 17 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 03 / 20 / 2009 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 03 / 21 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 10 / 14 / 2009 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 11 / 17 / 2008 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 02 / 11 / 2008 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 02 / 22 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 03 / 16 / 2009 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 03 / 07 / 2008 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 02 / 20 / 2008 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 03 / 03 / 2008 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 04 / 09 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 11 / 12 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 02 / 09 / 2009 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 04 / 15 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 01 / 28 / 2009 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 01 / 23 / 2009 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 02 / 19 / 2007 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 04 / 06 / 2009 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 09 / 28 / 2007 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 09 / 19 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 10 / 28 / 2009 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 01 / 28 / 2009 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 01 / 23 / 2009 Instructor: Michael Eckmann.
CS 330 Programming Languages 11 / 21 / 2006 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 04 / 20 / 2007 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 09 / 10 / 2009 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 01 / 26 / 2009 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 01 / 31 / 2007 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 03 / 21 / 2008 Instructor: Michael Eckmann.
CS 330 Programming Languages 11 / 13 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 02 / 23 / 2009 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 02 / 13 / 2009 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 09 / 11 / 2009 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 03 / 30 / 2009 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 02 / 09 / 2009 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 09 / 26 / 2007 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 02 / 03 / 2010 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 03 / 02 / 2007 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 02 / 02 / 2009 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 02 / 12 / 2008 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 09 / 10 / 2007 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 04 / 27 / 2009 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 03 / 10 / 2010 Instructor: Michael Eckmann.
CSx 4091 – Python Programming Spring 2013 Lecture L2 – Introduction to Python Page 1 Help: To get help, type in the following in the interpreter: Welcome.
CS 106 Introduction to Computer Science I 01 / 24 / 2007 Instructor: Michael Eckmann.
Presentation transcript:

CS 102 Computers In Context (Multimedia)‏ 03 / 25 / 2009 Instructor: Michael Eckmann

Michael Eckmann - Skidmore College - CS Spring 2009 Today’s Topics Questions/comments? Chapter 5 –Drawing our own pictures Getting input from the user

Michael Eckmann - Skidmore College - CS Spring 2009 Drawing our own pictures Let's finish our program from last time to create an image exactly like: greyeffect.jpg

Michael Eckmann - Skidmore College - CS Spring 2009 Getting input Many programs request information from the user at runtime. Your project (which will be assigned shortly) will require this too. input is a function that takes as a parameter a string that will be displayed to the user and provides an entry field for the user to enter his/her input. input returns what the user entered. So, how do you think we call this function?

Michael Eckmann - Skidmore College - CS Spring 2009 Getting input Many programs request information from the user at runtime. Your project (which will be assigned shortly) will require this too. input is a function that takes as a parameter a string that will be displayed to the user and provides an entry field for the user to enter his/her input. input returns what the user entered. So, how do you think we call this function? Example: userInput = input(“Enter a number please:”)‏

Michael Eckmann - Skidmore College - CS Spring 2009 Getting input input will allow the user to enter many different kinds of data including: –Integers –Real numbers –Strings (surrounded by quotes)‏

Michael Eckmann - Skidmore College - CS Spring 2009 JES Input functions There are some JES input functions that have some built-in error checking: requestNumber requestInteger requestString These functions all take in a String as a parameter and display it to the user and also provide an entry field for the user to enter their input. However, what the user enters is verified to be the correct type (integer, number, string). For example if the user enters Hello for requestInteger then the function reasks the user for input because s/he did not enter an integer (they entered a string).

Michael Eckmann - Skidmore College - CS Spring 2009 JES Input functions There's another JES input function: requestIntegerInRange This function takes in three parameters: a String which is displayed, and two integers (the minimum and maximum integers that you want the user to enter). What if we didn't have requestIntegerInRange but we only had requestInteger. Could we write a function that mimicked the behaviour of requestIntegerInRange?

Michael Eckmann - Skidmore College - CS Spring 2009 Let's write a menu Let's write a function that displays many options to the user like: 1. Multiply 2. Divide 3. Add 4. Subtract 5. Quit and allows the user to enter an option and performs the chosen functionality.