Welcome back to Software Development!

Slides:



Advertisements
Similar presentations
Pecan cinnamon cookies. Walnut Cinnamon Cookies 1/2 cup unsalted butter 3/4 cup granulated sugar, divided 1/4 cup packed light brown sugar 1 large egg.
Advertisements

Chocolate Chip Cookies. Ingredients: ½ cup butter (1 stick) 1/3 c. brown sugar (packed) 1/3 c. granulated sugar (white) 1 egg 1/ 2 t. vanilla 1 cup +
1.02 C Work Plans 1 The secret for success!. Why use a work plan? It is important to use a work plan to help meal preparation run smoothly. To implement.
Recipes.
Michelle Koch For other treats around the holidays, visit:
How To Make Chocolate Chip Cookies By: Kevin Klosky.
By KIANA,SABRINA,EDGAR Decker Healthy Eating Project.
Baking Chocolate Chip Cookies Ms. Davis Life Skill Class July 11th, 2004.
Fractions with Mom’s Chocolate Chip Jumbles By Margie MacDonald.
Cookies In All Kinds and Colors My favorite cookies by Ms. Kampner.
1.02 I Preparation Tasks List
White Chocolate Orange Cookies. 1 cup butter softened 1/2 cup white sugar 1/2 cup brown sugar 1 egg 1 tablespoon orange zest 2 1/4 cups all-purpose flour.
Ingredients 1 1/2 cups sugar 2/3 cup shortening or butter* 2 eggs 2 tablespoons milk 1 teaspoon vanilla extract 3 ¼ cups flour 2 1/2 teaspoons baking.
How to Make Delicious Snickerdoodle Cookies  Preheat the oven to 400 degrees  Grab the following tools needed:  An electric mixer  Medium bowl 
Baking Cookies Recipe Mixing Baking Final Product.
Taller de cocina en ingles. Naomi Hashimoto. Año 2011.
Things needed: 1. 1 cup unsweetened cocoa powder 2. 2 cups of white sugar 3. ½ cup of vegetable oil 4. 4 eggs 5. 2 teaspoons vanilla extract 6. 2 cups.
Streptococcus pneumoniae. Fig. 6.3b Avery, McCarty and MacLoed, 1944.
Welcome to Arista’S Baking!. Pick any Tasty Dessert to get started.
How to Make Chocolate Chip Cookies By Sara Hokkala.
1.02 I Preparation Tasks List 11.02I Listing Preparation Tasks.
Baking Cookies English Club eats chocolate chip cookies!
Title slide Name of your food Your name (may be alone or with 1 partner) 1 cup butter, softenedbutter 1 cup granulated sugargranulated sugar 3/4 cup light.
That’s Sweet! Lesson 3. Caleb - The Hebrew Boy Prayer - to talk with God in praise, petitions, or thanksgiving.
AcCooking 1C Cookie Company Founders: Tom Le, Reece Nocon, Sherwin Sampayan, Long Nguyen, Pam Tsai.
Stoichiometry Mrs. Russotto Best Ever Chewy Chocolate Chunk Cookies INGREDIENTS: 1/2 cup butter, softened 1/3 cup chocolate syrup 1 cup packed brown.
Warm Up Photosynthesis Prediction Cards – Using the cards, work with a partner to predict the process of photosynthesis from beginning to end.
1.02 C Work Plans 1 The secret for success!. Why use a work plan? Helps meal preparation run smoothly Implement these steps: 1.02CWork Plans2 Steps 1-
Dominika Lehocká.  2 cups all-purpose flour  1 cup white sugar  3/4 cup chocolate chips  1/2 cup unsweetened cocoa powder  1 teaspoon baking soda.
How to make a BIG sponge cake! By Gina kinsman.. Ingredients! You will need: ½ cup of milk 2 teaspoons & table spoons of unsalted butter 8 large eggs.
Stoichiometry Unit 6 Mrs. Mansberger Chemical Stoichiometry Stoichiometry - The study of quantities of materials consumed and produced in chemical reactions.
FROM SCRATCH UTENSILS NEEDED Original recipe makes 1 - 9x13 inch cake 9X13 Dish Pan Large Bowl.
Cookies !. Ingredients: 3/4 cup granulated sugar 3/4 cup packed brown sugar 1 cup butter or margarine, softened 1 teaspoon vanilla 1 egg 2 cups Gold Medal.
What you’ll need 2 ½ cups of all – purpose flour 1 teaspoon baking soda 1/2 teaspoon of salt 1 cup granulated sugar 2 eggs.
Functional Text. What is “functional text?” Instruction manuals Recipes Lists of facts (ex: nutrition facts) Table of contents Index Directions That is.
How to make chocolate chip cookies By Rose Savage.
How to Make Chocolate Chip Cookies Caity Jozwiak Period 6.
The 5 Parts of a Recipe Obj. F2.01 Remember recipe parts & resources.
Does chocolate chip cookie dough sit in the refrigerator for 48 hours before baking it? By: Brooke Giaccone-Hammell And Julie Sentman.
Chocolate Chip Cookie Recipe By: Allison Lange quart of butter -> Cups.
+ Chocolate Chip Cookies Diamond Britton. + Recipe (2 dozen) 1 teaspoon baking soda 1 teaspoon vanilla extract 1 large egg 1 cup flour 1 teaspoon salt.
Grease and lightly flour an 8x8x2-inch baking pan. Melt chocolate and butter; cool. Stir together flour, baking powder, and ¼ teaspoon salt. In a mixer.
Snicker Doodle Recipe By:Ashlee Kirkland. Items Needed to make the dough ½ cup each butter and shortening (or margin), at room temperature½ cup each butter.
How to Make Chocolate Chip Cookies
REESES PEANUT BUTTER CUP COOKIES By:Darnita Coles.
Chocolate Chip Cookies Measurements. Measure Smarter 18 (v) oz. all-purpose flour 1/3 T baking soda 3/4 t & 2 pinches salt 2 sticks butter, softened 12.
Stoichiometry Unit 6 ABClark-Grubb Chemical Stoichiometry Stoichiometry - The study of quantities of materials consumed and produced in chemical reactions.
How to Make Chocolate Chip Cookies Fast, Easy, and Yummy Original Author Unknown Modified By: CTAE Resource Network.
Your Name 1/4 cup unsalted butter, melted 1/2 teaspoon vanilla extract 1 egg, room temperature Set aside Andes Peppermint Chips. Scoop out and cream the.
Errors? Mistakes? Oh no!!!! Scientific Method Unit Ms. Ava Chiao IISME CK-12.org Independence High School San Jose, CA
Kitchen Measuring Equipment. Measuring 2 Categories of Measuring Equipment Liquid Dry.
Sour Cream Pound Cake. 2 cups butter, softened 3 cups white sugar 6 eggs 1 teaspoon vanilla extract.
Recipe Notes.
Cookies.
½ cup butter or margarine ½ cup peanut butter ¾ cup brown sugar
Candy Corn Sugar Cookies
How can we do cookies ?. How can we do cookies ?
Streptococcus pneumoniae
Maple Peanut Butter Thumbprint Cookies
Chocolate Chip Cookies
Concrete for Box Culverts – Wet Cast Concrete
Welcome back to Software Development!
Mg ion in Taq DNA polymerase
Welcome back to Software Development!
Welcome back to Software Development!
Let’s make Cookies!.
Cinnamon rolls Using the yeast dough.
Welcome back to Software Development!
Welcome back to Software Development!
1.02 C Work Plans The secret for success! 1.02C Work Plans.
Presentation transcript:

Welcome back to Software Development!

Review – Class Members Do review slides Finish MenuOption method project Instances and static Create UserInput class

Review – Class Members What are the three main types of class members?

Review – Class Members What are the three main types of class members? Methods

Review – Class Members What are the three main types of class members? Methods – class algorithms

Review – Class Members What are the three main types of class members? Methods – class algorithms The actual code that does the work – the ‘algorithm’

Review – Class Members What are the three main types of class members? Methods – class algorithms The actual code that does the work – the ‘algorithm’ Fields

Review – Class Members What are the three main types of class members? Methods – class algorithms The actual code that does the work – the ‘algorithm’ Fields – class variables any method of the class can use

Review – Class Members What are the three main types of class members? Methods – class algorithms The actual code that does the work – the ‘algorithm’ Fields – class variables any method of the class can use What the book calls “instance variables”

Review – Class Members What are the three main types of class members? Methods – class algorithms The actual code that does the work – the ‘algorithm’ Fields – class variables any method of the class can use What the book calls “instance variables” The data or information the class uses to do its job

Review – Class Members What are the three main types of class members? Methods – class algorithms The actual code that does the work – the ‘algorithm’ Fields – class variables any method of the class can use What the book calls “instance variables” The data or information the class uses to do its job Properties

Review – Class Members What are the three main types of class members? Methods – class algorithms The actual code that does the work – the ‘algorithm’ Fields – class variables any method of the class can use What the book calls “instance variables” The data or information the class uses to do its job Properties – “smart fields”

Review – Class Members What are the three main types of class members? Methods – class algorithms The actual code that does the work – the ‘algorithm’ Fields – class variables any method of the class can use What the book calls “instance variables” The data or information the class uses to do its job Properties – “smart fields” Methods that look like fields…you can use them almost like variables

Review – Class Members What are the three main types of class members? Methods – class algorithms The actual code that does the work – the ‘algorithm’ Fields – class variables any method of the class can use What the book calls “instance variables” The data or information the class uses to do its job Properties – “smart fields” Methods that look like fields…you can use them almost like variables They “protect” the class variables (fields)

Review - Scope

Review - Scope What does scope mean?

Review - Scope What does scope mean? The section of code a variable can be used in

Review - Scope What does scope mean? The section of code a variable can be used in Defined by the current block { }

Review - Scope What does scope mean? The section of code a variable can be used in Defined by the current block { } Inner blocks can see variables from outer blocks

Review - Scope What does scope mean? The section of code a variable can be used in Defined by the current block { } Inner blocks can see variables from outer blocks Outer blocks can not see variables from inner blocks

Review – Scope Modifiers

Review – Scope Modifiers We will call them access modifiers

Review – Scope Modifiers We will call them access modifiers What are access modifiers?

Review – Scope Modifiers We will call them access modifiers What are access modifiers? Keywords public and private

Review – Scope Modifiers We will call them access modifiers What are access modifiers? Keywords public and private Control who has access to the members of a class

Review – Scope Modifiers We will call them access modifiers What are access modifiers? Keywords public and private Control who has access to the members of a class public :

Review – Scope Modifiers We will call them access modifiers What are access modifiers? Keywords public and private Control who has access to the members of a class public : everyone has access and can change

Review – Scope Modifiers We will call them access modifiers What are access modifiers? Keywords public and private Control who has access to the members of a class public : everyone has access and can change private :

Review – Scope Modifiers We will call them access modifiers What are access modifiers? Keywords public and private Control who has access to the members of a class public : everyone has access and can change private : only members of same class have access and can change

Reading Questions

Reading Questions What are scope modifiers (public/private)

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)?

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? What is an instance (static and new)?

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? What is an instance (static and new)? What are instance variables?

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? What is an instance (static and new)? What are instance variables? What are filters?

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? What is an instance (static and new)? What are instance variables? What are filters?

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? What is an instance (static and new)? What are instance variables? What are filters? Properties that limit what can be done to a field

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? What is an instance (static and new)? What are instance variables? What are filters? Properties that limit what can be done to a field Yesterday’s example

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? What is an instance (static and new)? What are instance variables? What are filters? Properties that limit what can be done to a field Yesterday’s example Mario and Jackson “guarding” or “filtering” access to Jake’s grade

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? What is an instance (static and new)? What are instance variables? What are filters?

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? What is an instance (static and new)? What are instance variables? What are filters?

Reading Questions What are scope modifiers (public/private) What are properties (Set/Get)? What is an instance (static and new)? What are instance variables? What are filters?

The real, the original, the authentic Nestle Toll House Chocolate Chip Cookie Recipe 2 1/4 cups all-purpose flour 1 teaspoon baking soda 1 teaspoon salt 1 cup (2 sticks, 1/2 pound) butter, softened 3/4 cup granulated [white] sugar 3/4 cup packed brown sugar 1 teaspoon vanilla extract 2 eggs 2 cups (12-ounce package) NESTLE TOLL HOUSE Semi-Sweet Chocolate Morsels 1 cup chopped nuts COMBINE flour, baking soda and salt in small bowl. Beat butter, granulated sugar, brown sugar and vanilla in large mixer bowl. Add eggs one at a time, beating well after each addition; gradually beat in flour mixture. Stir in morsels and nuts. Drop by rounded tablespoon onto ungreased baking sheets. BAKE in preheated 375-degree [Fahrenheit] oven for 9 to 11 minutes or until golden brown. Let stand for 2 minutes; remove to wire racks to cool completely. PAN COOKIE VARIATION: PREPARE dough as above. Spread into greased 15"x10" jelly-roll pan. Bake in preheated 375-degree [Fahrenheit] oven for 20 to 25 minutes or until golden brown. Cool in pan on wire rack. FOR HIGH ALTITUDE BAKING (>5,200 feet): INCREASE flour to 2 1/2 cups; add 2 teaspoonfuls water with flour; reduce both granulated sugar and brown sugar to 2/3 cup each. Bake at 375 degrees Fahrenheit, drop cookies for 8 to 10 minutes and pan cookies for 17 to 19 minutes If I give this recipe to you, what good is it? Can you eat this recipe? No, you have to make a cookie from the recipe…

Instance

Instance A class is like a recipe

Instance A class is like a recipe You can’t eat the recipe (unless you like paper…)

Instance A class is like a recipe You can’t eat the recipe (unless you like paper…) You have to make a cookie

Instance A class is like a recipe You can’t eat the recipe (unless you like paper…) You have to make a cookie The cookie is an “instance” of the recipe

Instance A class is like a recipe You can’t eat the recipe (unless you like paper…) You have to make a cookie The cookie is an “instance” of the recipe You have “created” or “declared” a cookie from the recipe

Instance A class is like a recipe You can’t eat the recipe (unless you like paper…) You have to make a cookie The cookie is an “instance” of the recipe You have “created” or “declared” a cookie from the recipe Now you can “use” the cookie

Instance A class is like a recipe You can’t eat the recipe (unless you like paper…) You have to make a cookie The cookie is an “instance” of the recipe You have “created” or “declared” a cookie from the recipe Now you can “use” the cookie You have to create an instance of a class to use it…

Instance A class is like a recipe You can’t eat the recipe (unless you like paper…) You have to make a cookie The cookie is an “instance” of the recipe You have “created” or “declared” a cookie from the recipe Now you can “use” the cookie You have to create an instance of a class to use it… Except…

Instance A class is like a recipe You can’t eat the recipe (unless you like paper…) You have to make a cookie The cookie is an “instance” of the recipe You have “created” or “declared” a cookie from the recipe Now you can “use” the cookie You have to create an instance of a class to use it… Except…Unless…

Instance A class is like a recipe You can’t eat the recipe (unless you like paper…) You have to make a cookie The cookie is an “instance” of the recipe You have “created” or “declared” a cookie from the recipe Now you can “use” the cookie You have to create an instance of a class to use it… Except…Unless…the some part of the class is useful all by itself…

The Coffee Pot Show coffee pot Ask what its function is Make coffee Ask what you have to do to use that function Add water and coffee Can you make the coffee if you don’t add water and coffee grounds?

The Coffee Pot Think of a coffee pot as an object…

The Coffee Pot Think of a coffee pot as an object…a class

The Coffee Pot Think of a coffee pot as an object…a class It has one method

The Coffee Pot Think of a coffee pot as an object…a class It has one method – MakeCoffee()

The Coffee Pot Think of a coffee pot as an object…a class It has one method – MakeCoffee() It has two fields

The Coffee Pot Think of a coffee pot as an object…a class It has one method – MakeCoffee() It has two fields 1) amountOfWater

The Coffee Pot Think of a coffee pot as an object…a class It has one method – MakeCoffee() It has two fields 1) amountOfWater 2) amountOfCoffeeGrounds

The Coffee Pot Think of a coffee pot as an object…a class It has one method – MakeCoffee() It has two fields 1) amountOfWater 2) amountOfCoffeeGrounds The method needs the fields to work

The Coffee Pot Think of a coffee pot as an object…a class It has one method – MakeCoffee() It has two fields 1) amountOfWater 2) amountOfCoffeeGrounds The method needs the fields to work Does this class have any use not requiring the fields?

The Coffee Pot Think of a coffee pot as an object…a class It has one method – MakeCoffee() It has two fields 1) amountOfWater 2) amountOfCoffeeGrounds The method needs the fields to work Does this class have any use not requiring the fields? The glass pot can carry water…

The Coffee Pot Think of a coffee pot as an object…a class It has one method – MakeCoffee() It has two fields 1) amountOfWater 2) amountOfCoffeeGrounds The method needs the fields to work Does this class have any use not requiring the fields? The glass pot can carry water…acts as a water pitcher

The Coffee Pot Think of a coffee pot as an object…a class It has one method – MakeCoffee() It has two fields 1) amountOfWater 2) amountOfCoffeeGrounds The method needs the fields to work Does this class have any use not requiring the fields? The glass pot can carry water…acts as a water pitcher We have a new method

The Coffee Pot Think of a coffee pot as an object…a class It has one method – MakeCoffee() It has two fields 1) amountOfWater 2) amountOfCoffeeGrounds The method needs the fields to work Does this class have any use not requiring the fields? The glass pot can carry water…acts as a water pitcher We have a new method – UseAsWaterPitcher()

Static Methods

Static Methods Some methods do not need to use any of the class fields

Static Methods Some methods do not need to use any of the class fields Examples:

Static Methods Some methods do not need to use any of the class fields Examples: Your “get user input” methods:

Static Methods Some methods do not need to use any of the class fields Examples: Your “get user input” methods: HitEnterTo()

Static Methods Some methods do not need to use any of the class fields Examples: Your “get user input” methods: HitEnterTo() GetString()

Static Methods Some methods do not need to use any of the class fields Examples: Your “get user input” methods: HitEnterTo() GetString() GetNumber()

Static Methods Some methods do not need to use any of the class fields Examples: Your “get user input” methods: HitEnterTo() GetString() GetNumber() GetMenuOption()

Static Methods Some methods do not need to use any of the class fields Examples: Your “get user input” methods: HitEnterTo() GetString() GetNumber() GetMenuOption() These can be static methods

Static Methods Some methods do not need to use any of the class fields Examples: Your “get user input” methods: HitEnterTo() GetString() GetNumber() GetMenuOption() These can be static methods Most methods do need to use some of the class fields

Static Methods Some methods do not need to use any of the class fields Examples: Your “get user input” methods: HitEnterTo() GetString() GetNumber() GetMenuOption() These can be static methods Most methods do need to use some of the class fields These can not be static methods

Static Methods

Static Methods static

Static Methods static The keyword static means it doesn’t use any of the class fields

Static Methods static The keyword static means it doesn’t use any of the class fields You can use static methods without creating an instance of the class

Non-static Methods

Non-static Methods To use methods of a class that are not static…

Non-static Methods To use methods of a class that are not static… You must create an instance of the class

Non-static Methods To use methods of a class that are not static… You must create an instance of the class … as a variable using keyword new

Non-static Methods To use methods of a class that are not static… You must create an instance of the class … as a variable using keyword new Example:

Non-static Methods To use methods of a class that are not static… You must create an instance of the class … as a variable using keyword new Example: the class Random…

Non-static Methods To use methods of a class that are not static… You must create an instance of the class … as a variable using keyword new Example: the class Random… Random rndNum;

Non-static Methods To use methods of a class that are not static… You must create an instance of the class … as a variable using keyword new Example: the class Random… Random rndNum; Variable name

Non-static Methods To use methods of a class that are not static… You must create an instance of the class … as a variable using keyword new Example: the class Random… Random rndNum; Variable type Variable name

Non-static Methods To use methods of a class that are not static… You must create an instance of the class … as a variable using keyword new Example: the class Random… Random rndNum; Variable type Variable name Declaring a variable named rndNum of type Random

Non-static Methods To use methods of a class that are not static… You must create an instance of the class … as a variable using keyword new Example: the class Random… Random rndNum; Variable type Variable name Declaring a variable named rndNum of type Random You have created the “recipe” … you haven’t baked the cookie yet

Non-static Methods To use methods of a class that are not static… You must create an instance of the class … as a variable using keyword new Example: the class Random… Random rndNum = new Random();

Non-static Methods To use methods of a class that are not static… You must create an instance of the class … as a variable using keyword new Example: the class Random… Random rndNum = new Random(); Create the recipe

Non-static Methods To use methods of a class that are not static… You must create an instance of the class … as a variable using keyword new Example: the class Random… Random rndNum = new Random(); Create the recipe Bake the cookie… …create an instance of the class Random as a variable

Non-static Methods To use methods of a class that are not static… You must create an instance of the class … as a variable using keyword new Example: the class Random… Random rndNum = new Random(); Create the recipe Bake the cookie… …create an instance of the class Random as a variable Keyword new is used to create an instance of a class

Non-static Methods To use methods of a class that are not static… You must create an instance of the class … as a variable using keyword new Example: the class Random… Random rndNum = new Random(); int a = rndNum.Next(1, 20);

Instance Variables

Instance Variables The term the book uses for fields

Instance Variables The term the book uses for fields Fields are the variables of a class

Instance Variables The term the book uses for fields Fields are the variables of a class You can’t use a class with fields unless you make an instance of the class

Instance Variables The term the book uses for fields Fields are the variables of a class You can’t use a class with fields unless you make an instance of the class Hence…

Instance Variables The term the book uses for fields Fields are the variables of a class You can’t use a class with fields unless you make an instance of the class Hence…instance variables

Instance Variables The term the book uses for fields Fields are the variables of a class You can’t use a class with fields unless you make an instance of the class Hence…instance variables We will simply use the term fields

Creating a class

Creating a class class nameOfClass

Creating a class class nameOfClass { members of the class (fields, properties, methods) }

Creating a class class nameOfClass { members of the class (fields, properties, methods) }

Your task

Your task Make a class containing all your “get user input” methods

Your task Make a class containing all your “get user input” methods Name the class GetUserInput

Your task Make a class containing all your “get user input” methods Name the class GetUserInput This will be a completely static class

Your task Make a class containing all your “get user input” methods Name the class GetUserInput This will be a completely static class Every method in it will be static

Your task Make a class containing all your “get user input” methods Name the class GetUserInput This will be a completely static class Every method in it will be static It will have four methods in it:

Your task Make a class containing all your “get user input” methods Name the class GetUserInput This will be a completely static class Every method in it will be static It will have four methods in it: HitEnterTo()

Your task Make a class containing all your “get user input” methods Name the class GetUserInput This will be a completely static class Every method in it will be static It will have four methods in it: HitEnterTo() GetString()

Your task Make a class containing all your “get user input” methods Name the class GetUserInput This will be a completely static class Every method in it will be static It will have four methods in it: HitEnterTo() GetString() GetNumber()

Your task Make a class containing all your “get user input” methods Name the class GetUserInput This will be a completely static class Every method in it will be static It will have four methods in it: HitEnterTo() GetString() GetNumber() GetMenuSelection()