1 / / / /. 2 (Object) (Object) –, 10 (Class) (Class) –, –, – (Variables) [ Data member Field Attribute](, ) – (Function) [ Member function Method Operation.

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

LEUCEMIA MIELOIDE AGUDA TIPO 0
You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Advanced Piloting Cruise Plot.
Chapter 1 The Study of Body Function Image PowerPoint
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 5 Author: Julia Richards and R. Scott Hawley.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
1 Chapter 40 - Physiology and Pathophysiology of Diuretic Action Copyright © 2013 Elsevier Inc. All rights reserved.
By D. Fisher Geometric Transformations. Reflection, Rotation, or Translation 1.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
My Alphabet Book abcdefghijklm nopqrstuvwxyz.
0 - 0.
ALGEBRAIC EXPRESSIONS
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
MULTIPLYING MONOMIALS TIMES POLYNOMIALS (DISTRIBUTIVE PROPERTY)
ADDING INTEGERS 1. POS. + POS. = POS. 2. NEG. + NEG. = NEG. 3. POS. + NEG. OR NEG. + POS. SUBTRACT TAKE SIGN OF BIGGER ABSOLUTE VALUE.
MULTIPLICATION EQUATIONS 1. SOLVE FOR X 3. WHAT EVER YOU DO TO ONE SIDE YOU HAVE TO DO TO THE OTHER 2. DIVIDE BY THE NUMBER IN FRONT OF THE VARIABLE.
SUBTRACTING INTEGERS 1. CHANGE THE SUBTRACTION SIGN TO ADDITION
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
FACTORING Think Distributive property backwards Work down, Show all steps ax + ay = a(x + y)
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Addition Facts
Year 6 mental test 5 second questions
Around the World AdditionSubtraction MultiplicationDivision AdditionSubtraction MultiplicationDivision.
ZMQS ZMQS
Richmond House, Liverpool (1) 26 th January 2004.
BT Wholesale October Creating your own telephone network WHOLESALE CALLS LINE ASSOCIATED.
ADTs unsorted List and Sorted List
ABC Technology Project
1 Structures. 2 Structure Basics A structure is a collection of data values, called data members, that form a single unit. Unlike arrays, the data members.
© S Haughton more than 3?
© Charles van Marrewijk, An Introduction to Geographical Economics Brakman, Garretsen, and Van Marrewijk.
© Charles van Marrewijk, An Introduction to Geographical Economics Brakman, Garretsen, and Van Marrewijk.
© Charles van Marrewijk, An Introduction to Geographical Economics Brakman, Garretsen, and Van Marrewijk.
VOORBLAD.
1 public class Newton { public static double sqrt(double c) { double epsilon = 1E-15; if (c < 0) return Double.NaN; double t = c; while (Math.abs(t - c/t)
Twenty Questions Subject: Twenty Questions
Linking Verb? Action Verb or. Question 1 Define the term: action verb.
Squares and Square Root WALK. Solve each problem REVIEW:
© 2012 National Heart Foundation of Australia. Slide 2.
Lets play bingo!!. Calculate: MEAN Calculate: MEDIAN
Past Tense Probe. Past Tense Probe Past Tense Probe – Practice 1.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Chapter 5 Test Review Sections 5-1 through 5-4.
SIMOCODE-DP Software.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
1 First EMRAS II Technical Meeting IAEA Headquarters, Vienna, 19–23 January 2009.
Addition 1’s to 20.
25 seconds left…...
Test B, 100 Subtraction Facts
Januar MDMDFSSMDMDFSSS
Week 1.
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
1 Unit 1 Kinematics Chapter 1 Day
PSSA Preparation.
How Cells Obtain Energy from Food
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14: More About Classes.
Copyright © 2012 Pearson Education, Inc. Chapter 14: More About Classes.
Chapter 30 Induction and Inductance In this chapter we will study the following topics: -Faraday’s law of induction -Lenz’s rule -Electric field induced.
static void Main() { int i = 0; if (i == 0) { int a = 5; int b = 15; if (a == 5) { int c = 3; int d = 99; }
Chapter 9: Using Classes and Objects. Understanding Class Concepts Types of classes – Classes that are only application programs with a Main() method.
Traktor- og motorlære Kapitel 1 1 Kopiering forbudt.
Presentation transcript:

1 / / / /

2 (Object) (Object) –, 10 (Class) (Class) –, –, – (Variables) [ Data member Field Attribute](, ) – (Function) [ Member function Method Operation Responsibilities] ( ) ( )

3 (Encapsulation) (Encapsulation) (private) (private) – – – (public) (public)

4 Card Card

5 CardDemo.Program (1/2) /* * * * 3/14/2009 * 3/14/2009 */ */ using System; namespace CardDemo { class Program class Program { static void Main(string[] args) static void Main(string[] args) {

6 CardDemo.Program (2/2) Card diamond_10 = new Card(); Card diamond_10 = new Card(); diamond_10.SetSuit('d'); diamond_10.SetSuit('d'); diamond_10.SetRank(10); diamond_10.SetRank(10); char suit = diamond_10.GetSuit(); char suit = diamond_10.GetSuit(); int rank = diamond_10.GetRank(); int rank = diamond_10.GetRank(); Console.WriteLine("{0}{1}", diamond_10.GetSuit(), Console.WriteLine("{0}{1}", diamond_10.GetSuit(), diamond_10.GetRank()); } }}

7 CardDemo.Card (1/3) /* * * * 3/14/2009 * 3/14/2009 */ */ using System; namespace CardDemo { class Card class Card { private char suit; private char suit; private int rank; private int rank;

8 CardDemo.Card (2/3) public void SetSuit(char s) public void SetSuit(char s) { suit = s; suit = s; } public void SetRank(int r) public void SetRank(int r) { rank = r; rank = r; }

9 CardDemo.Card (3/3) public char GetSuit() public char GetSuit() { return suit; return suit; } public int GetRank() public int GetRank() { return rank; return rank; } }}

10 (1/6) (1/6) Card diamond_10 = new Card(); diamond_10.SetSuit('d'); diamond_10.SetRank(10); char suit = diamond_10.GetSuit(); int rank = diamond_10.GetRank(); Console.WriteLine("{0}{1}", diamond_10.GetSuit(), diamond_10.GetSuit(), diamond_10.GetRank()); diamond_10.GetRank()); Program.Main() Diamond_10 suit rank diamond_10 class Card { private char suit; private char suit; private int rank; private int rank;......}

11 (2/6) (2/6) Card diamond_10 = new Card(); diamond_10.SetSuit('d'); diamond_10.SetRank(10); char suit = diamond_10.GetSuit(); int rank = diamond_10.GetRank(); Console.WriteLine("{0}{1}", diamond_10.GetSuit(), diamond_10.GetSuit(), diamond_10.GetRank()); diamond_10.GetRank()); Program.Main() diamond_10 suit rank diamond_10 d class Card { public void SetSuit(char s) public void SetSuit(char s) { suit = s; suit = s; }......}

12 (Parameters, Arguments) (Parameters, Arguments) – (Formal Parameters) – (Actual Parameters)

13 d s Main SetSuit diamond_10 suit rank Program

14 static void Main(string[] args) { dimond_10.SetSuit( d ); class Card { private suit;... public void SetSuit( char s ) { suit = s; }... } }

15 (3/6) (3/6) Card diamond_10 = new Card(); diamond_10.SetSuit('d'); diamond_10.SetRank(10); char suit = diamond_10.GetSuit(); int rank = diamond_10.GetRank(); Console.WriteLine("{0}{1}", diamond_10.GetSuit(), diamond_10.GetSuit(), diamond_10.GetRank()); diamond_10.GetRank()); Program.Main() diamond_10 suit rank diamond_10 d 10 class Card { public void SetRank(int r) public void SetRank(int r) { rank = r; rank = r; }......}

16 (4/6) (4/6) Card diamond_10 = new Card(); diamond_10.SetSuit('d'); diamond_10.SetRank(10); char suit = diamond_10.GetSuit(); int rank = diamond_10.GetRank(); Console.WriteLine("{0}{1}", diamond_10.GetSuit(), diamond_10.GetSuit(), diamond_10.GetRank()); diamond_10.GetRank()); Program.Main() diamond_10 suit rank diamond_10 d 10 suitd class Card { public char GetSuit() public char GetSuit() { return suit; return suit; }......}

17 Main suit GetSuit suit rank diamond_10 Program

18 char suit = dimond_10.GetSuit(); static void Main(string[] args) { } }} }... class Card { private suit;... public char GetSuit() { return suit; }... }

19 (5/6) (5/6) Card diamond_10 = new Card(); diamond_10.SetSuit('d'); diamond_10.SetRank(10); char suit = diamond_10.GetSuit(); int rank = diamond_10.GetRank(); Console.WriteLine("{0}{1}", diamond_10.GetSuit(), diamond_10.GetSuit(), diamond_10.GetRank()); diamond_10.GetRank()); Program.Main() diamond_10 suit rank diamond_10 d 10 suitd rank 10 class Card { public int GetRank() public int GetRank() { return rank; return rank; }}

20 (6/6) (6/6) Card diamond_10 = new Card(); diamond_10.SetSuit('d'); diamond_10.SetRank(10); char suit = diamond_10.GetSuit(); int rank = diamond_10.GetRank(); Console.WriteLine("{0}{1}", diamond_10.GetSuit(), diamond_10.GetSuit(), diamond_10.GetRank()); diamond_10.GetRank()); Program.Main() diamond_10 suit rank diamond_10 d 10 suitd rank 10 > d 10 class Card { public char GetSuit() public char GetSuit() { return suit; return suit; } public int GetRank() public int GetRank() { return rank; return rank; }}

21 (Attribute, Property) (Attribute, Property) class Card { private char suit; private int rank; public void SetSuit(char s) { suit = s; } public void SetRank(int r) { rank = r; } public char GetSuit() { return suit; } public int GetRank() { return rank; } class Card { private char suit; private int rank; public char Suit { set { suit = value; } get { return suit; } } public int Rank { set { rank = value; } get { return rank; } }

22 Card diamond_10 = new Card(); diamond_10.Suit='d'; diamond_10.Rank=10; char suit = diamond_10.Suit; int rank = diamond_10.Rank; Console.WriteLine("{0}{1}", diamond_10.Suit, diamond_10.Rank); Card diamond_10 = new Card(); diamond_10.SetSuit('d'); diamond_10.SetRank(10); char suit = diamond_10.GetSuit(); int rank = diamond_10.GetRank(); Console.WriteLine("{0}{1}", diamond_10.GetSuit(), diamond_10.GetRank());

CardDemo CardDemo 23