cs 180 problem solving and object oriented programming fall 2011
DESCRIPTION
CS 180 Problem Solving and Object Oriented Programming Fall 2011. http://www.cs.purdue.edu/homes/apm/courses/CS180Fall2011/. This class:. Centipede game Review Final Exam Best wishes. 12/7. Notes for the Final Lecture Dec 7, 2011. Aditya Mathur Department of Computer Science - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/1.jpg)
CS 180 Problem Solving and Object Oriented Programming Fall 2011
Notes for the Final LectureDec 7, 2011
Aditya MathurDepartment of Computer SciencePurdue UniversityWest Lafayette, IN, USA
http://www.cs.purdue.edu/homes/apm/courses/CS180Fall2011/
This class:
12/7 1. Centipede game2. Review3. Final Exam4. Best wishes
![Page 2: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/2.jpg)
Programming and the
“Nupe”d! MomentsOh! Moments
Wow! Moments
![Page 3: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/3.jpg)
Project 5
Black Screen does not show!
Mushrooms do not show!
Centipede does not move!
Nuped! (Null pointer exception ()
Nuped!
Nuped!
![Page 4: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/4.jpg)
Project 5: and more
Centipede moving too fast!!
Projectiles do not move!
GameLogic loop does not execute! Oh S…
Nuped!
Nuped!
![Page 5: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/5.jpg)
Project 5: and more and more
Ship not moving past the mushrooms
Projectiles not colliding with the centipede!
Nuped!
And more…but then?
![Page 6: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/6.jpg)
Project 5: The End!
Finally!!!
Aaaaah…It all works!
Thanks CS 180!
![Page 7: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/7.jpg)
Centipede Game: Advanced versionDeep Space Remix
By
Denis Luchkin-Zhou
![Page 8: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/8.jpg)
Java classes Used
• Graphics: Draw screen and game characters• Point, Dimension, Rectangle: Positioning and
collision• Font, Font Metrics: Drawing text• Robot: Locking the mouse• Image: Ship, asteroids, centipede, background• Use of texturing• Animation: modified implementation of circular
buffer
![Page 9: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/9.jpg)
Additional Game Features
• Weapon upgrades• Debugging mode• Object pooling: efficiency of memory usage• Mega laser• Chained asteroid explosion: Asteroids around an
exploding asteroids are damaged based on hit-points
• Game menu• Overall design
![Page 10: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/10.jpg)
Now-- Demo by Denis!
![Page 11: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/11.jpg)
Course Review
![Page 12: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/12.jpg)
Chapter 1
• No questions from this chapter on the final exam• Number systems (binary, hexadecimal, octal)• Integers and floating point numbers• Conversion across bases (e.g., int to binary)• Errors in number representation• Overflow and underflow
![Page 13: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/13.jpg)
Chapters 2 and 3
• Program structure• Variables, constants, operations (+, -, %, /, etc.)• Statements• Strings• Primitive types: int, long, double, boolean etc.• Conversion across types• Math library• Classes and objects• Scanner
![Page 14: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/14.jpg)
Chapters 4 and 5
• If-then and if-then-else statements• Loops:– while and for statements
![Page 15: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/15.jpg)
Chapter 7
• Arrays:– Single dimension– Double dimension– Array creation– Array index bounds exception– Looping through arrays– Searching and sorting
![Page 16: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/16.jpg)
Chapter 8
• Methods:– Method signature– Parameters– Return type and void– Recursive methods– GCD and Fibonacci– Tree creation and traversal
![Page 17: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/17.jpg)
Chapter 9
• Classes and objects:– Constructors– Instance variables– Instance methods– Access modifiers (public, private)– Object creation and use– Arrays of objects
![Page 18: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/18.jpg)
Chapters 10 and 11
• Interfaces and inheritance– Implementation of interface– Interfaces in GUI construction– Access restriction
![Page 19: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/19.jpg)
Chapter 12
• Exceptions– Try-catch-finally
![Page 20: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/20.jpg)
Chapter 14
• Creating a thread• The run() method• Passing data to a thread• Getting data from a thread• Dividing work amongst thread• start() and join()
![Page 21: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/21.jpg)
Chapter 18
• Trees• Creation• Searching• Traversing
![Page 22: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/22.jpg)
Chapter 19
• File objects• Opening and closing files• Reading and writing into files
![Page 23: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/23.jpg)
Final Exam:
Friday 12/16: 1-3pm. LAMBF101
![Page 24: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/24.jpg)
Part A
• Closed book/notes• 10 Multiple choice questions• Chapters 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 18, 19• You may ignore the chapters NOT listed above• To prepare, review:– the quiz questions during in class quizzes – the conceptual problems at the end of the chapters
mentioned above.
![Page 25: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/25.jpg)
Final Exam: Part B
• Open book/notes; no laptop, etc; no internet connection
• Chapters 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 18, 19• Two programming questions• Q1: You will be asked to write several short
methods.• Q2: You will be asked to write one concurrent
program.
![Page 26: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/26.jpg)
Final Exam: Part B
• Recursion: Yes• Threads: Yes• GUI: No (no listeners)• Binary numbers: No• Synchronization (wait and notify): No
![Page 27: CS 180 Problem Solving and Object Oriented Programming Fall 2011](https://reader035.vdocument.in/reader035/viewer/2022062410/5681659c550346895dd876a5/html5/thumbnails/27.jpg)
Thank you!
For this most enjoyable class!
Best wishes for success in the rest of your career at Purdue and beyond!