280 likes | 301 Views
Learn the basics of OOP, class interactions, UML, inheritance, and Java programming concepts. Topics include grades policy, homework guidelines, lecture activities, and tips for getting good grades.
E N D
Object Oriented Programming Ch1. Intro to OOP Lecture 1 Iksan Bukhori, M.Phil iksan.bukhori@president.ac.id 2018
Textbook and Syllabus Textbook: • Wu, C. Thomas. An Introduction to Object-Oriented Programming With Java. MCGraw-Hill: New York, USA. 2010. • Deitel, H. M. & Deitel, P. J. JAVA How to Program (Seventh Edition). Pearson Education, Inc.: New Jersey, USA. 207. Syllabus: (tentative) Chapter 1: Intro to OOP Chapter 2: Getting Started with Java Chapter 3: Numerical Data Chapter 4: Defining Your Own Classes – Part 1 Chapter 5: Selection Statements Chapter 6: Repetition Statements Chapter 7: Defining Your Own Classes – Part 2 Chapter 10: Arrays and Collections
Grade Policy Grade Point: 85 – 100 : A (GPA = 4) 70 – 84 : B (GPA = 3) 60 – 69 : C (GPA = 2) 55 – 59 : D (GPA = 1) 0 – 54 : E (GPA = 0) • Always bring a laptop installed with IDE to class. • The use of smartphone in quizzes and exams is prohibited.
Grade Policy Grades: Final Grade = 10% Homeworks + 20% Quizzes + 30% Midterm Exam + 40% Final Exam + Extra Points • Homeworks will be given in fairly regular basis. The average of homework grades contributes 10% of final grade. • Written homeworks are to be written on A4 papers, otherwise they will not be graded. • Programming homework should follow these rules • Homeworks must be submitted on time, ten minutes after the class begins. If you submit late, the penalty will be –10·n points, where n is the total number of lateness made.
Grade Policy • Extra points will be given if you solve a problem in front of the class. You will earn 1, 2, or 3 points. • Make up of quizzes and exams will be held withinone week after the schedule of the respective quizzes and exams. • To maintain the integrity, the maximum score of a make up quiz or exam can be set to 90. • Any project/homework given should not be plagiarizing existing programs available on the internet. If that is the case, no grade shall be given. • The grade for any program (either on paper or not) will be divided by the number of students having the same program.
Lecture Activities • Lectures will be held in the form of PowerPoint presentations. • You are expected to write a note along the lectures to record your own conclusions or materials which are not covered by the lecture slides. How to get good grades in this class? • Do the homeworks by yourself • Take time to learn at home • Ask questions
JAVA Development Environment : -Eclipse -Netbeans -Jcreator -etc.
OOP: Classes and Objects OBJECT OBJECT Interaction Example of Objects: • Arwin • Wilbert • A door
OOP: Classes and Objects Class: Student Class: Wood Furniture Arwin Wilbert Objectsare instances of class of certain types. Door
Messages and Method Message: What is sent to an object or a class to perform certain task Shout (15) John Doe: Student Shout (15) ? Door: Wood Furniture Method: How an object or a class do the task
Instance Method One-way Comm Two-way Comm
Class Data Values vs Instance Data Values IDV What happens when the bank wants to change minimum balance?
Class Representation in UML Book Class name • Title: String • Author: String • Category: String • Year Published: Integer=1945 Instance variables/Instance Data Values • getDueDate() • isAvailable() Class Operations/Instance Methods
Inheritance Graduate Undergraduate Features = = Using a single class to describe two or more entities is a bad design !!
Inheritance Superclass/ancestor/base class Subclass/descendant/derived class
Homework • Graphically represents a person class with • Instance variables name, age, and gender. • Instance methods setName, getName, and getAge • Class method getAverageAge • Consider a student registration program used by the registrar’s office. The program keeps track of students who are registered for a given semester. For each student registered, the program maintains the student’s name, address, and phone number; the number of classes in which the student is enrolled; and the student’s total credit hours. The program also keeps track of the total number of registered students. Define instance and class variables of a Student class that is suitable for this program. • Suppose the minimum number and maximum number of courses for which a student can register are different depending on whether the student is a graduate, undergraduate, or work/study student. Redo Exercise 2 by defining classes for different types of students. Relate the classes, using inheritance.
Next Week • Getting started with Java Do Not Forget to Prepare your IDE!