Search Header Logo
CSA [03] Arrays and Algorithms - Lesson 2 - One-Dimensional (1D) Arrays

CSA [03] Arrays and Algorithms - Lesson 2 - One-Dimensional (1D) Arrays

Assessment

Presentation

•

Information Technology (IT)

•

12th Grade

•

Practice Problem

•

Hard

Created by

Derrick Heffelfinger

Used 1+ times

FREE Resource

33 Slides • 25 Questions

1

media

2

Multiple Choice

Why do you think one-dimensional arrays are important in computer science?

1

They help organize data efficiently

2

They make programs run slower

3

They are only used for graphics

4

They are not useful in programming

3

media

4

Open Ended

What prior experiences have you had with organizing information in lists or sequences, either in daily life or in programming?

5

media

6

Open Ended

How could we store the dessert flavor values in a program based on what we know about Java?

7

media

8

media

9

Fill in the Blanks

By the end of this lesson, you will be able to: 1) Declare and initialize a one-dimensional (1D) array using the

Type answer...

keyword. 2) Determine the length of a one-dimensional (1D) array.

10

media

11

Multiple Choice

Which of the following is the correct way to declare and initialize a one-dimensional array of integers with 5 elements in Java?

1

int[] arr = new int[5];

2

int arr = new int[5];

3

int arr[] = 5;

4

array int[5];

12

Open Ended

How can I store multiple related values without creating multiple variables?

13

media

14

Multiple Choice

What are two things you should do when you are asked to 'Predict and Run' a program?

1

Predict the output and then run the program to compare results

2

Write new code and run it

3

Ask a friend for the answer

4

Skip the prediction and just run the code

15

media

16

media

17

Open Ended

Why would we use a 1D array in our programs?

18

media

19

Multiple Select

Which of the following are purposes of a data structure?

1

Organizing data

2

Processing data

3

Retrieving data

4

Storing data

20

Multiple Choice

Which of the following best describes a one-dimensional (1D) array?

1

A structure that holds multiple values of different types

2

A structure that holds multiple values of the same type

3

A structure that holds a single value

4

A structure that holds multiple objects of different types

21

media

22

Multiple Choice

What is the index of the element with value 8 in the array shown?

1

0

2

2

3

3

4

4

23

Fill in the Blanks

A data structure contains zero or more

Type answer...

.

24

media

25

media

26

media

27

Open Ended

What did you discover from the modifications you made to the code?

28

media

29

media

30

media

31

Multiple Choice

Which of the following statements correctly declares and initializes a 1D array of integers with 5 elements in one line?

1

int[] scores = new int[5];

2

int scores = new int[5];

3

int[] scores = int[5];

4

int[] scores = new int[];

32

media

33

Multiple Choice

In the array 'scores' shown, what is the value stored at index 3?

1

85

2

93

3

97

4

73

34

media

35

Fill in the Blanks

When a 1D array of integers is initialized using the new keyword, each element is automatically assigned the default value

Type answer...

.

36

media

37

Multiple Select

Select all statements that are true about default values assigned to arrays in Java.

1

int arrays are assigned 0 by default

2

double arrays are assigned 0.0 by default

3

String arrays are assigned null by default

4

boolean arrays are assigned true by default

38

media

39

Multiple Choice

What is the default value of each element in a boolean array in Java when it is first created?

1

false

2

true

3

null

4

0

40

media

41

Multiple Choice

Why is the default value of a String array in Java set to null?

1

Because String is an object

2

Because String is a primitive type

3

Because String must be initialized to empty string

4

Because String arrays cannot have default values

42

media

43

media

44

Open Ended

Explain how you can determine the number of elements in a one-dimensional array in Java.

45

media

46

Multiple Select

Which of the following statements about 1D arrays in Java are correct?

1

The length of a 1D array is accessed using the .length attribute.

2

The last index of a 1D array is always one less than its length.

3

The default value for an int array is 0.

4

The default value for a String array is an empty string.

47

Fill in the Blanks

The length of a 1D array is always

Type answer...

more than the last index.

48

media

49

Open Ended

How can 1D arrays be useful in analyzing survey data, such as the Music & Mental Health Survey Results?

50

media

51

media

52

media

53

media

54

media

55

media

56

media

57

Open Ended

Do you have any questions or topics you would like to explore further about one-dimensional arrays?

58

Open Ended

What is one thing you learned about one-dimensional arrays in today's lesson?

pattern-tertiary
media

Show answer

Auto Play

Slide 1 / 58

SLIDE