Intro Problem Solving W
Intro Problem Solving W CMPSCI 121
Popular in Course
Popular in ComputerScienence
This 16 page Class Notes was uploaded by Roman McCullough on Friday October 30, 2015. The Class Notes belongs to CMPSCI 121 at University of Massachusetts taught by Erik Learned-Miller in Fall. Since its upload, it has received 27 views. For similar materials see /class/232253/cmpsci-121-university-of-massachusetts in ComputerScienence at University of Massachusetts.
Reviews for Intro Problem Solving W
Report this Material
What is Karma?
Karma is the currency of StudySoup.
Date Created: 10/30/15
Lecture May 12 Graphics continued CMPSCI 121 Spring 2009 Introduction to Problem Solving with Computers Prof LearnedMiller Final Survey I Complete for extra credit I Find it under regular assignment location in OWL Logistics Final this Thursday May 14 1030am 2 hours long Location Mahar Auditorium 108 Special office hours today and tomorrow I announcement will be sent via email Covers the whole Ebook all lectures Review slides I Professor Smaragdakis slides I Check quotexam partquot of Class web page I Some material you are not responsible for However useful to read through I Please don39t email and ask if you are responsible for certain material Look in Ebook or at lecture slides Other review material I Midterm 1 I Midterm 2 I Understanding quotaliasingquot References to objects Casting 0 Cat 0 new Cat 0 Animal a c 0 Cat c2 Cat a quotActual classquot of an object I Material on interfaces Review in detail drawable example from class Graphics I What do I need to know about graphics on the exam I Review the snake program I How would you change which keys control the snake I How would you make the snake appear as ovals instead of squares I How would you change the color of one of the snakes l impart javaawt 2 import javaxswing 3 impart javaawtevent 4 5 public class anatnr extends JPanel implements MuuaeListener E int xy 7 String lacatian quot E 9 Locatar 1U addMauseListenerfthis 11L 1 12 13 public void painthmgnnent Graphics g 14 gdraw3tringlacatinnxyj5 15 16 1 public void mauseClicked HouseEvent BJ 13 x egetxj y EgetYj 19 location quot x quot y 20 repaintl 21 22 23 public void mouseEnteredtMcuseEvant e 24 public vcid mauseExitchHausaEvant e K 25 public void muusePressedIchseEvent eh 26 public void mmuseReleasedIHauscEvent e 1 import javaawt 2 impart javaxswing 3 impart javaawtevent 4 5 public class Line lickcr attends JPanel implements McuseListaner E int uldx IntegerMIHUALUE int aid 2 IntegerMIHVALUE 3 int nawx D 9 int new a D 111 11 public Lineclickar 12 add cuseListenerIthisl 13 14 public void painthmpancntl raphics gl 15 gdrawLinecldE midi nawx newf 16 1 public vcid mouse licked cuse vent e 13 cldx new cldf a new 19 newx eget new cget j EU repaint 21 I 22 23 public vcid mauseEntered McuseEvant e 24 public void mnuseExitedanuseEvent E 25 public void mausePresaedfMouacEvcnt e BE public vcid mouseRcleascd McuseEvent e ques on I How would we make sure that we don39t quotlosequot the work we39ve already done in the line segment painter 1 import javaawt 2 impart javaxswing 3 impart javaawtcvent 4 5 public class DvalDrag extends JPanel implements Heuschtianistcner E int x IntegerHIEVALUE T int y IntegerMIHVALUE B 9 public val rag 1U adnduseHotianiEtenerfthisl 11 12 13 public vci paint umpcncnttGraphics g 14 gdraw valx y Z yf l yf j 15 1E 17 public void mouse ragged ouseEvent B 13 x cgetX 19 y eget j 2D rcpaintf 21 22 23 public void mauschvcd chseEvent e Snake mods I a look back You ve come a long way public class Gr etings public static vuid main 3tring args Syatem utprint HcLo quotj Sy temnutprint ouL a Systemnutprintquotthercrjg public class InfantTester public static void main String args Infant my id new Infant Lizzic 4 int lizAge myKidgetAgejg Systemoutprintlnquotmy kid39s name is myKidanotherHDnth Systemoutprintln my kid is now my idgetHametjh myEidgetAgel months j Where do go from here I 187 Data Structures I Starting more advanced concepts I Trees Hash tables Heaps Lists etc I CS minor I Majors I BS I BA fewer requirements not approved yet but will be soon Congratulations