
CC 102-Computer Programming I
Authored by John Marpa
Computers
Professional Development
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
18 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 2 pts
1. Which of the following declares an array of integers?
A. int array;
B. int[] array;
C. int array[];
D. Both B and C
2.
MULTIPLE CHOICE QUESTION
10 sec • 2 pts
2. What is the index of the first element in an array?
A. -1
B. 0
C. 1
D. None of the above
3.
MULTIPLE CHOICE QUESTION
10 sec • 2 pts
How can you access the length of an array arr?
A. arr.size
B. arr.length
C. arr.length()
D. arr.getSize()
4.
MULTIPLE CHOICE QUESTION
10 sec • 2 pts
What will happen if you try to access an array index that is out of bounds?
A. The program will run normally.
B. An ArrayIndexOutOfBoundsException will be thrown.
C. The program will skip that index.
D. None of the above
5.
MULTIPLE CHOICE QUESTION
20 sec • 2 pts
What will this code print?
int[] arr = {10, 20, 30, 40, 50};
System.out.println(arr[2]);
10
20
30
40
6.
MULTIPLE CHOICE QUESTION
20 sec • 2 pts
Which of these is a valid for loop to iterate over an array arr?
A. for (int i : arr)
B. for (int i = 0; i < arr.length; i++)
C. for (int i = 0; i <= arr.length; i++)
D. Both A and B
7.
MULTIPLE CHOICE QUESTION
20 sec • 2 pts
Given int[] arr = {5, 10, 15};,
what does System.out.println(arr.length); output?
2
3
4
5
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
21 questions
CPA MS-Office Hotkeys Quiz
Quiz
•
8th Grade - Professio...
13 questions
Functions
Quiz
•
5th Grade - Professio...
18 questions
HC Análisis y reconocimiento de la interfaz (V1)
Quiz
•
Professional Development
20 questions
DI (EM24) - Diseño de Contenidos (T8)
Quiz
•
University - Professi...
13 questions
Everything Facebook Revealed About The Metaverse CNET
Quiz
•
6th Grade - Professio...
14 questions
DECI - Week 12 - round
Quiz
•
Professional Development
13 questions
Wirusy komputerowe
Quiz
•
1st Grade - Professio...
16 questions
DP-900 MÓDULO 4 pt-br
Quiz
•
Professional Development
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Computers
10 questions
How to Email your Teacher
Quiz
•
Professional Development
6 questions
3RD GRADE DECLARATION OF INDEPENDENCE EXIT TICKET
Quiz
•
Professional Development
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
22 questions
Multiplying Exponents with the Same Base
Quiz
•
9th Grade - Professio...
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...