Java Lesson 36 Mr. Kalmes.

Slides:



Advertisements
Similar presentations
Overloading Having more than one method with the same name is known as overloading. Overloading is legal in Java as long as each version takes different.
Advertisements

Continuation of chapter 6…. Nested while loop A while loop used within another while loop is called nested while loop. Q. An illustration to generate.
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
1 Classes and Objects in Java Parameter Passing, Delegation, Visibility Control, and Object Cleanup.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 3: Flow Control I: For Loops.
EXAMPLES (Arrays). Example Many engineering and scientific applications represent data as a 2-dimensional grid of values; say brightness of pixels in.
Introduction to Computer Science Robert Sedgewick and Kevin Wayne Copyright © Recursive GCD Demo public class.
Introduction to Computer Science Robert Sedgewick and Kevin Wayne Recursive Factorial Demo pubic class Factorial {
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Picture It Very Basic Game Picture Pepper. Original Game import java.util.Scanner; public class Game { public static void main() { Scanner scan=new Scanner(System.in);
1 MATH METHODS THAT RETURN VALUES. 2 JAVA'S MATH CLASS.
Inheritance // A simple class hierarchy. // A class for two-dimensional objects. class TwoDShape { double width; double height; void showDim() { System.out.println("Width.
Overloading methods review When is the return statement required? What do the following method headers tell us? public static int max (int a, int b)
Random (1) Random class contains a method to generate random numbers of integer and double type Note: before using Random class, you should add following.
Classes. Student class We are tasked with creating a class for objects that store data about students. We first want to consider what is needed for the.
The Math class Java provides certain math functions for us. The Math class contains methods and constants that can be very useful. The Math class is like.
9.4 POLAR FORM OF A LINEAR EQUATION By the end of the section students will be able to write the polar form of a linear equation, and write the linear.
Creating and Using Class Methods. Definition Class Object.
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
College Board Topics – A.P. Computer Science A Program Design - Read and understand a problem's description, purpose, and goals; Apply data abstraction.
CPSC 233 Tutorial 5 February 9 th /10 th, Java Classes Each Java class contains a set of instance variables and methods Instance Variables: Type.
Methods What is a method? Main Method the main method is where a stand alone Java program normally begins execution common compile error, trying.
JAVA METHODS (FUNCTIONS). Why are they called methods? Java is a strictly object-oriented programming language Methods are functions inside of objects.
Methods. Creating your own methods Java allows you to create custom methods inside its main body. public class Test { // insert your own methods right.
JUST BASIC Lessons 6 – 9 Mr. Kalmes.
using System; namespace Demo01 { class Program
Foundations of Programming: Arrays
Math Methods that return values
RADE new features via JAVA
Lecture 10: More on Methods and Scope
Agenda Warmup Lesson 2.5 (Ascii, Method Overloading)
Register Use Policy Conventions
Chapter 4 Procedural Methods.
Method Mark and Lyubo.
Methods Additional Topics
Static Methods 14-Nov-18.
Python Lesson 6 Mr. Kalmes.
March 29th Odds & Ends CS 239.
TO COMPLETE THE FOLLOWING:
Lesson 15 Linear Equations The Slope Formula.
Python Lessons 9 & 10 Mr. Kalmes.
Python Lessons 13 & 14 Mr. Kalmes.
Python Lesson 21 Mr. Kalmes.
Method Overloading in JAVA
Java Lessons 17 – 20 Mr. Kalmes.
Java Lessons 28 – 32 Mr. Kalmes.
Java Lesson 35 Mr. Kalmes.
Just Basic Lessons Mr. Kalmes.
Python Lessons 9 & 10 Mr. Husch.
Java Lessons 5 – 8 Mr. Kalmes.
Chapter 7 Procedural Methods.
Just Basic Lesson 17 Part 1 Mr. Kalmes.
Just Basic Lessons 14 Mr. Kalmes.
Lesson Similarity of Triangles
Just Basic Lessons 7&8 Mr. Kalmes.
Just Basic Lessons Mr. Kalmes.
Just Basic Lesson 12 Mr. Kalmes.
Just Basic Lessons 9 Mr. Kalmes.
Agenda Warmup Lesson 2.2 (parameters, etc)
Just Basic Lesson 19 Mr. Kalmes.
Python Lessons 7 & 8 Mr. Kalmes.
Java Lessons Mr. Kalmes.
Lecture 22: Number Systems
Java Lessons 9 – 12 Mr. Kalmes.
Subtype Substitution Principle
Random Numbers while loop
Just Basic Lessons 7 Mr. Kalmes.
Just Basic Lessons 8 Mr. Kalmes.
Chapter 8 Similarity.
Triangle Basics Lesson 2
Presentation transcript:

Java Lesson 36 Mr. Kalmes

Learning Targets I will be able to explain why parameters are important to functions I will be able to create a program that uses functions

Lesson 36 some functions have parameters and some do not. Parameters are the only way to send values into a function. There is also only one way to get a value out of a function: the return value.

Lesson 36 +++ Add to the program +++ *** find the area of a triangle with sides 9, 9, and 9 ***

Lesson 36 Important Takeaways: The function does not use Public Static Void Void is used when the function does not return a value There are other types Void – Does not return a value Int – Returns a integer value Double – Returns a double value String – Returns a string value

Exit Slip Why are parameters important for functions List 2 different types of return values of a function