chap4-schedule.docx - chap 4 Finish the crab game...

  • No School
  • AA 1
  • 5

This preview shows page 1 - 2 out of 5 pages.

chap 4 Finish the crab game Objectives Learn how to create object use the keyword new, and keyword super. Learn how to create and assign values to primitive type variables, and to objects. Understand that objects are class type variables. Understand the difference between instance variable in a class and local variable in a method Understand that assignment operator = is different from equal comparator == Learn how to use image and how to use constructor Learn how to create an OOP class in Eclipse, and create an application class to test the OOP class Learn how to draw UML class diagram for OOP class, and export UML class diagram to an image file Schedule: This lesson covers Moodle folder “chap 4”. Please follow the steps below. 1, work on sec 4.1 ~ 4.15, and finish the little crab game from exercise 4.1 to 4.26. During the process, you need to know how to create object and use object, and apply images to your game. Scenarios covered and used in this chapter: little-crab-4 and little-crab-5, 2, work on sec 4.16 to learn the new ideas about expanding the little crab game. 3, work on sec 4.10 and learn how to use the “code completion” feature of the Greenfoot IDE to search for APIs. 4, work on textbook exercises 4.35, and learn how to create a scenario from scratch, and how to customize the subclass of the class World. You also need to invoke APIs in greenfoot to detect whether the Ball class object has reached any edge or not. 5, Download and unzip file “UML-classDiagram.zip” in Moodle folder “chap 4”, then finish the following tasks: View file “CorrectSequence.java” with a source editor such as Notepad++ (in Windows) or BBEdit(in Mac, and understand the correct sequence of writing an class with OOP principles from scratch. Create an Eclipse Java project, and include file BookOrder.java and TestBookOrder.java into this project. Please refer to file “ CompileAndRunTheFirstJavaProgram.docx ” in Moodle folder “chap 1” on how to create an Eclipse project and how to include existing java files into the project. In file “CompileAndRunTheFirstJavaProgram.docx”, I explain how to include an existing java source code file into Eclipse project. And in the example here, you need to include two source code files “BookOrder.java” and “TestBookOrder.java”, and the approach is the same: you just repeat the drag-and-drop process twice, and place these two files into the “src” folder of the Eclipse project. Read file BookOrder.java, which is an example of the correct sequence of writing an OOP class, and cross reference BookOrder.java with CorrectSequence.java. We call BookOrder the OOP class , or the class obeys the encapsulation principle. Read file TestBookOrder.java, which is an application file that makes use of the OOP class: BookOrder. We call class TestBookOrder the user class , or application class , which uses the class BookOrder.
Image of page 1

Subscribe to view the full document.

Image of page 2

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes