Variables
-
Upload
paul-daniels -
Category
Documents
-
view
224 -
download
3
Transcript of Variables
WelcomeWelcome
1. Name one of the rules for creating a valid Java identifier
Mr. Daniels
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
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?
2 Gas Mileage2 Gas Mileage
We need 3 variables
How much gasoline the tank can hold
Miles per gallon Distance on a tank
3 Perimeter of a Triangle3 Perimeter of a Triangle4 variables
Leg A
Leg B
Leg C
A
B
C
4 Area of a Circle4 Area of a Circle3 variables
pi
distance from the edge to the center
5 Circumference of a Circle5 Circumference of a Circle3 variables
pi
distance through the center
6 Area of Rectangle6 Area of Rectangle
The length of a rectangle is 9, the width is 5. Find the area of the rectangle.
6 Area of a Rectangle6 Area of a Rectangle
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.