Search Header Logo

AP CS A Edhesive Unit 3

Authored by Anne Kohart

Computers

10th - 12th Grade

Used 26+ times

AP CS A Edhesive Unit 3
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

4 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given String str. How do you find the length of the string?

Use a for loop to count the elements

str.length;

str.length();

str[0].length();

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given and array of 7 integers called nums. How do you access the LAST element?

nums[7]

nums[nums.length] - 1

nums[nums.length - 1]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these correctly assigns initializes a max so that the max value in an array can be found?

int max = 0;

int max = Integer.MAX_VALUE;

int max = Integer.MIN_VALUE;

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you find the sum in an array?

Given

int sum = 0;

int [] nums = {1,2,23,4,5445,7}

for (i = 0; i < nums.length; i++)

sum +=nums;

nums[i] += sum;

sum += nums[i];

sum = nums[0]+nums[1];

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?