Class 2 Mon 1/14 Comp 110 Java security --- A Java update will be issued tomorrow. It patches a security flaw that arises when running Java in your browser (not Eclipse). MAKE SURE YOU INSTALL IT --- A good practice (that I am adopting for the future) is to use Firefox with the 'noscript' add-on. This will allow you to control which web sites that are allowed to run executable code (including Java) in your browser. 5 Building Blocks of Every Program Variable - data Branch - asking a question and making a choice Loop - repetitive Method - bundle of Java statement + variables they share Class - bundle of methods + variables they share Listing 1.1 and 1.2 illustrate variable, method and class (no branch or loop) Peanut Butter and Jelly ...... Grasp lid of PB jar Twist counterclockwise 3 full rotations Remove lid Place lid on table Pickup knife Insert knife into PB jar Remove knife Swipe knife on bread ...... INCLASS EXERCISE - turn in one solution per group, print your names Program robot to make one sandwhich for everyone Lesson - must PRECISELY define problem before starting to program Given instructions to make 1 PB&J, program robot to make one sandwhich for each of the 136 students in the class count = 0 make 1 PB&J if( count == 136 ) we are done else go back to 'make 1 PB&J' Writing these instructions in more Java-like form count = 0 while( count < 136 ) make 1 PB&J count = count + 1