
CC104 SUMMATIVE TEST
Quiz
•
Information Technology (IT)
•
University
•
Hard
John Patrick Eleria
Used 2+ times
FREE Resource
50 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
A program needs to store 25,000 integer values for temporary calculations, prioritizing memory efficiency over range. Which primitive data type would be most suitable for this array, and how much memory would it approximately consume?
An 'int' array, consuming around 100 KB, offers sufficient range for calculations.
A 'short' array, consuming approximately 50 KB, provides better memory efficiency.
A 'long' array, consuming 200 KB, is ideal for comprehensive integer storage needs.
A 'byte' array, consuming only 25 KB, is the most memory-efficient choice.
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider a Java class with an instance variable `isProcessed` (boolean) and a local variable `counter` (int) initialized to 0. If `isProcessed` is not explicitly set in the constructor, what are their initial values when an object is created?
`isProcessed` is `true`, and `counter` is `0` by explicit initialization.
Both `isProcessed` and `counter` would be `0` or `false` by default values.
`isProcessed` is `false`, and `counter` is `0` as explicitly set.
`isProcessed` is `null`, and `counter` remains uninitialized.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Evaluate the output of the following Java code snippet: `int x = 15; int y = 10; if (x > y * 2) { System.out.print("Alpha"); } else if (x == y + 5) { System.out.print("Beta"); } else { System.out.print("Gamma"); }`
The output will be "Alpha" because x is greater than y times two.
The output will be "Beta" because x equals y plus five.
The output will be "Gamma" as no conditions are met by the variables.
The code contains a syntax error preventing any output from being generated.
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
A program uses a `switch` statement with an integer variable `code = 2`. The cases are `case 1: System.out.print("Red"); break; case 2: System.out.print("Green"); case 3: System.out.print("Blue"); break; default: System.out.print("Unknown");`. What will be the output?
The program will output "Green" due to a direct match.
The program will output "GreenBlue" because of fall-through behavior.
The program will output "Unknown" as there is no specific break.
The program encounters an error with multiple cases matching.
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
A system needs to determine a user's access level. If `age` is 18 or higher, access is "Full"; otherwise, it's "Limited". Which ternary operation correctly implements this logic for `String accessLevel`?
`accessLevel = (age > 18) ? "Full" : "Limited";`
`accessLevel = (age >= 18) ? "Full" : "Limited";`
`accessLevel = "Full" ? (age >= 18) : "Limited";`
`accessLevel = (age < 18) ? "Full" : "Limited";`
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider a `for` loop: `for (int k = 1; k < 5; k++) { System.out.print(k + " "); }`. What will be the final sequence of numbers printed to the console?
The loop will print '1 2 3 4 5' before stopping.
The output will be '1 2 3 4' because the condition is exclusive.
The loop will result in '0 1 2 3 4' if the initialization was zero.
Only '5' will be printed as the final iteration value.
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
A `while` loop is defined as: `int count = 3; while (count > 0) { System.out.print(count + " "); count--; }`. How many times will "count" be printed, and what is the last value printed?
It prints 4 times, with the last value being 0.
It prints 3 times, and the last value displayed is 1.
It prints 3 times, with the last value printed being 0.
It prints indefinitely, causing an infinite loop error.
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
50 questions
CNTT NÂNG CAO - P1 MÔ ĐUN 09 – XỬ LÝ POWERPOINT NÂNG CAO
Quiz
•
University
50 questions
тест2
Quiz
•
University
50 questions
Ulangan Informatika kelas 9 Bab Berfikir Komputasional
Quiz
•
9th Grade - University
50 questions
INTRO TO ICT TEST
Quiz
•
University
47 questions
Digital Citizenship and Spreadsheets
Quiz
•
7th Grade - University
52 questions
Module 2: Attacks, Concepts, and Techniques
Quiz
•
University
50 questions
9- класс
Quiz
•
9th Grade - University
50 questions
Аналитической химии 1 - 50
Quiz
•
University
Popular Resources on Wayground
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
4 questions
Activity set 10/24
Lesson
•
6th - 8th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
How to Email your Teacher
Quiz
•
Professional Development
15 questions
Order of Operations
Quiz
•
5th Grade
30 questions
October: Math Fluency: Multiply and Divide
Quiz
•
7th Grade
Discover more resources for Information Technology (IT)
10 questions
Halloween Movies Trivia
Quiz
•
5th Grade - University
7 questions
Central Idea of Informational Text
Interactive video
•
4th Grade - University
7 questions
Review for You: Using Commas
Interactive video
•
4th Grade - University
5 questions
Using Context Clues
Interactive video
•
4th Grade - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
14 questions
Eat Healthy,Be Healty
Quiz
•
4th Grade - University
7 questions
Safari Scholar: Searching for Subject-Verb Agreement
Interactive video
•
4th Grade - University
