Midterm Thursday, in class.

Slides:



Advertisements
Similar presentations
Complete Structure class Date {class Date { private :private : // private data and functions// private data and functions public :public : // public data.
Advertisements

Introduction to classes Sangeetha Parthasarathy 06/11/2001.
CLASS INHERITANCE Class inheritance is about inheriting/deriving properties from another class. When inheriting a class you are inheriting the attributes.
Review of Inheritance. 2 Several Levels of Inheritance Base Class B Derived class D Derived class D1.
C++ Classes & Data Abstraction
Introduction to C# Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
Written by: Dr. JJ Shepherd
Inheritance. 2 The process of deriving new class from the existing one is called inheritance Then the old class is called base class and the new class.
CS 4800 By Brandon Andrews.  Specifications  Goals  Applications  Design Steps  Testing.
Final and Static Keywords. Creating constants  There will be occasions where data items in a program have values that do not change.  Maximum score.
Aalborg Media Lab 23-Jun-15 Inheritance Lecture 10 Chapter 8.
Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 9: Pass-by-Value.
CS102--Object Oriented Programming Review 1: Chapter 1 – Chapter 7 Copyright © 2008 Xiaoyan Li.
UML Class Diagram: class Rectangle
Inheritance. © 2004 Pearson Addison-Wesley. All rights reserved 8-2 Inheritance Inheritance is a fundamental object-oriented design technique used to.
DT265-2 Object Oriented Software Development 2 Lecture 3 : Windows Programming Lecturer Pat Browne
Inheritance using Java
Chapter 15 – Inheritance, Virtual Functions, and Polymorphism
Chapter 11 Inheritance and Composition. Chapter Objectives Learn about inheritance Learn about subclasses and superclasses Explore how to override the.
Return function Random function Recursion function Function in C 1.
Chapter 8. About the Midterm Exam.. Exam on March 12 Monday (Tentatively) Review on March 7 Wednesday Cover from Chapter 6 Grades will be out before spring.
Tuc Goodwin  Object and Component-Oriented Programming  Classes in C#  Scope and Accessibility  Methods and Properties  Nested.
Current Assignments Homework 3 is due tonight. Iteration and basic functions. Exam 1 on Monday.
ILM Proprietary and Confidential -
Chapter 10 Inheritance and Polymorphism
CS 376b Introduction to Computer Vision 01 / 23 / 2008 Instructor: Michael Eckmann.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6: Transition to Java Programming with Alice and Java First Edition.
Kim B. Bruce, Andrea Danyluk & Tom Murtagh Williams College † Partially supported by NSF CCLI grant DUE Java: An Eventful Approach An innovative.
Review for Final Exam. Contents 5 questions (20 points each) + 1 bonus question (20 points) – Basic concepts in Chapters 1-4 – Chapters 5-9 – Bonus: Chapter.
Outline Class and Object-Oriented Programing –Encapsulation and inheritance Example –Commission Employee –Encapsulation and inheritance Strings and Formatting.
LECTURE 20: RECURSION CSC 212 – Data Structures. Humorous Asides.
CITA 342 Section 1 Object Oriented Programming (OOP)
Lecture-3 Functions and Recursion. C Preprocessor Includes header files like stdio.h Expands macros defined Handles conditional compilations PreprocessorProcessor.
Written by: Dr. JJ Shepherd
CSC 205 Java Programming II Introduction. Topics Syllabus Course goals and approach Review I Java language fundamentals.
Session 7 Introduction to Inheritance. Accumulator Example a simple calculator app classes needed: –AdderApp - contains main –AddingFrame - GUI –CloseableFrame.
Presented by Ted Higgins, SQL Server DBA An Introduction to Object – Oriented Programming.
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
Classes Sujana Jyothi C++ Workshop Day 2. A class in C++ is an encapsulation of data members and functions that manipulate the data. A class is a mechanism.
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
NESTED CLASS. Apa itu nested class ? Nested class is a class defined inside a class, that can be used within the scope of the class in which it is defined.
Programming in Java Transitioning from Alice. Becomes not myFirstMethod but …. public static void main (String[] arg) { // code for testing classes goes.
INTRODUCTION TO CLASSES & OBJECTS CREATING CLASSES USING C#
Java 5 Class Anatomy. User Defined Classes To this point we’ve been using classes that have been defined in the Java standard class library. Creating.
Java Programming: Guided Learning with Early Objects Chapter 9 Inheritance and Polymorphism.
Review for Test2. Scope 8 problems, 60 points. 1 Bonus problem (5 points) Coverage: – Test 1 coverage – Exception Handling, Switch Statement – Array of.
Programming With Java ICS201 University Of Ha’il1 ICS 201 Introduction to Computer Science Inheritance.
Written by: Dr. JJ Shepherd
Classes C++ representation of an object
Review What is an object? What is a class?
Object Oriented Programming
UML Class Diagram: class Rectangle
CS360 Windows Programming
User-Defined Classes and ADTs
Simple Classes in C# CSCI 293 September 12, 2005.
While Loop Design ENGI 1020 Fall 2018.
Polymorphism CT1513.
Review for Final Exam.
CIS 199 Test 02 Review.
Recap Week 2 and 3.
Simple Classes in Java CSCI 392 Classes – Part 1.
Review for Final Exam.
Welcome back to Software Development!
By Rajanikanth B OOP Concepts By Rajanikanth B
CIS 199 Final Review.
Constructors/Destructors Functions Revisited
Final Review Dr. Xiaolin Hu.
Chapter 11 Classes.
Extending Classes Through Inheritance
...that can get messy when we have lots buttons!
Presentation transcript:

Midterm Thursday, in class. Cheat sheet only, close form, no electronics

Classes Event Handling GUI Components Variables, methods, constructors Control structures Inheritance Access scope Event Handling GUI Components

Trace control structures – inclass exercise Write control structure-related code – class sample Private, protected, and public - inclass exercise Write a simple class – Projects #1, #2 & #3 Concepts about Classes – Projects #1, #2 & #3 Concepts about Events and Event handling - Projects #2, #3 Concepts about GUI Components - Project #3

Examples CMyShape MyCar class (project #2) Re cap of class exercises

break & continue int sum=0; for (int i=1; i<=10; i++) { if (i%5==0) continue; sum += i; // sum = sum+i; } if (i%5==0) break;

What will be printed? for (int j=0; j<9; j++) { switch (i) { for (int i=0; i<3; i++) { for (int j=0; j<9; j++) { switch (i) { case 0: break; case 1: continue; } Console::WriteLine(10*i+j); if (j==4) { else {

Access modifiers Public Private Protected Accessible by external functions and methods Accessible to derived ref classes Private Not accessible by external functions and methods Not accessible to derived ref classes Protected

Are They Accessible? ref class B { private: int a; protected: int b; public: int c; public: void bbb() { Console::Write(“{0}\n”, a); // accessible? Console::Write(“{0}\n”, b); // accessible? Console::Write(“{0}\n”, c); // accessible? } }; ref class A: public B { public: void bbb(int a) { Console::Write(“{0}\n”, this->a); // accessible? ref class C { public: void ccc() { B ^b = gcnew B(); Console::Write(“{0}\n”, b->a); // accessible? Console::Write(“{0}\n”, b->b); // accessible? Console::Write(“{0}\n”, b->c); // accessible?