- An array is a sequence of values
- Used to store multiple values of the same type using a single variable
- The size of the array is fixed, determined when created
- The values in the array are called elements
- Elements in arrays are accessed using an index
- The index starts at 0, not 1
Creating Arrays
Accessing Elements
- Code
- Ilustrasi
- Code
- Ilustrasi
Displaying Arrays
- False
- True
- True
Array length
.length : digunakan untuk mengetahui panjang array yang dimiliki oleh suatu array
Copying Arrays
- False
- True
Array Traversal
- True
- True
String char Array
Exercise
- Question 1
- Answer 1
- Create an array that can hold 15 integers
- Fill up each element of the array with the number 123
- Then display the contents of the array

- Question 2
- Answer 2
- Create an array that can hold 5 integers
- Fill up the array with user inputs
- Then display the contents of the array

- Question 3
- Answer 3
- Create an array that can hold integers
- is user input
- Fill up the array with user inputs
- Then display the contents of the array

- Question 4
- Answer 4
- Create an array that can hold integers
- is user input
- Fill up the array with user inputs
- Then display the contents of the array starting from the last element to the first

- Question 5
- Answer 5
- Create an array that can hold integers
- is user input
- Fill up the array with user inputs
- Then display the contents of the array starting from the last element to the first

- Question 6
- Answer 6
- Make a program to check whether a word entered by a user is palindrome or not
- A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward
- Examples:
- eye
- level
- radar
- madam
- refer
- …

- Question 7
- Answer 7
- Write a program that asks the user to enter the student’s name and grade n times.
- After all data is entered, the user can search for the grade of a student by entering his name.
- The program stops when the user enters “-” when asked for the name


