IT
NOTES
CREDS: CAILIN SMITH 2021
, TABLE OF CONTENTS
-
01 -
03
Variables Compare Strings
- Asking for Input - Generate a random number
- Conversions - For loops
- Showing Output
02 04
- Calculations - If/else statements
- Math Class - Switch case statements
- Rounding off to a - Pseudocode
specifi c decimal place - Trace Tables
,01
- Variables
- Asking for Input
- Conversions
- Showing Output
, - .length() tells you how long the String is
Variables Eg. name.length()
- .charAt(0) gives us the first letter.
Eg. if the name = “Bob” (String)
name.charAt(0) would give u ‘B’
Object data types have certain
name.charAt(1) would give you ‘o’
methods that we can use eg. .length()
- these are char variables now so its ‘ ‘
and .charAt(0)
Primitive data types can’t use these
methods, but we can use Math. Primitive Data Types: Object Data Types:
- They are more limited int String
Note: String starts with a capital double
letter.
char
NOTES
CREDS: CAILIN SMITH 2021
, TABLE OF CONTENTS
-
01 -
03
Variables Compare Strings
- Asking for Input - Generate a random number
- Conversions - For loops
- Showing Output
02 04
- Calculations - If/else statements
- Math Class - Switch case statements
- Rounding off to a - Pseudocode
specifi c decimal place - Trace Tables
,01
- Variables
- Asking for Input
- Conversions
- Showing Output
, - .length() tells you how long the String is
Variables Eg. name.length()
- .charAt(0) gives us the first letter.
Eg. if the name = “Bob” (String)
name.charAt(0) would give u ‘B’
Object data types have certain
name.charAt(1) would give you ‘o’
methods that we can use eg. .length()
- these are char variables now so its ‘ ‘
and .charAt(0)
Primitive data types can’t use these
methods, but we can use Math. Primitive Data Types: Object Data Types:
- They are more limited int String
Note: String starts with a capital double
letter.
char