Variables

10
Welcome Welcome 1. Name one of the rules for creating a valid Java identifier Mr. Daniels

Transcript of Variables

Page 1: Variables

WelcomeWelcome

1. Name one of the rules for creating a valid Java identifier

Mr. Daniels

Page 2: Variables

Valid Identifiers…Valid Identifiers…1. must start with a letter2. consist of only letters and

numbers; no symbols, punctuation or spaces

3. cannot use reserved words4. use capitals for each new word in a

phrase

Page 3: Variables

2 Gas Mileage2 Gas Mileage

A car's gas tank holds 23 gallons and averages 15 miles per gallon. How far can the car go on one tank of gas?

Page 4: Variables

2 Gas Mileage2 Gas Mileage

We need 3 variables

How much gasoline the tank can hold

Miles per gallon Distance on a tank

Page 5: Variables

3 Perimeter of a Triangle3 Perimeter of a Triangle4 variables

Leg A

Leg B

Leg C

A

B

C

Page 6: Variables

4 Area of a Circle4 Area of a Circle3 variables

pi

distance from the edge to the center

Page 7: Variables

5 Circumference of a Circle5 Circumference of a Circle3 variables

pi

distance through the center

Page 8: Variables

6 Area of Rectangle6 Area of Rectangle

The length of a rectangle is 9, the width is 5. Find the area of the rectangle.

Page 9: Variables

6 Area of a Rectangle6 Area of a Rectangle

Page 10: Variables

7 Perimeter of a Rectangle7 Perimeter of a Rectangle

The length of a rectangle is 5, the width is 3. Find the perimeter of the rectangle.