Introduction to Computer Science

Quiz
•
Computers
•
12th Grade
•
Hard
Used 47+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
In the statement below, the value stored in variable temp is called ___________?
double temp = Math.pow(3, 4);
argument
return value
input
method call
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What value is returned by the method call Math.pow (1 + 2, 3) ?
3.0
6.0
9.0
27.0
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the following code segment:
String str1 = "ONE";
String str2 = "TWO";
System.out.print(str2 + str1);
What will be printed when this code segment is executed?
str1str2
str2str1
ONETWO
TWOONE
TWO ONE
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following Java statements displays the message "Hello World" on the console window?
print("Hello World");
System.out.print("Hello" + "World");
System.print("Hello World");
System.out.print("Hello" + " " + "World");
System.out("Hello World");
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following is a valid variable declaration? Assume that length is a variable of type int and milesPerGallon a variable of type double.
int volume = length * length * length;
in gallonsConsumed = milesDriven / milesPerGallon;
double greeting = "HelloHello";
String greeting = 2 * "Hello";
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following represents a correct way to declare and initialize a variable named counter?
counter = 1;
int counter = 1;
int counter = "one";
int counter = 1.0;
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Assuming that variable dollars and cost have been declared, which of the following assignment statements is INVALID?
cost = dollars + 100;
cost = cost + 50;
dollars + 100 = cost;
dollars = cost;
8.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Assuming that in is a properly initialized object of the Scanner class, which of the following code segments is most appropriate for reading an integer value to be entered by the user?
System.out.print("Please enter the number of tests");
int tests = in.nextInt();
System.out.println("Please enter the number of tests: ");
int tests = in.nextInt();
System.out.print("Please enter the number of tests: ");
int tests = in.nextInt();
System.out.print("Please enter the number of tests: ");
double tests = in.nextInt();
Similar Resources on Wayground
9 questions
Python Programming Basics

Quiz
•
6th - 12th Grade
11 questions
python basics

Quiz
•
9th - 12th Grade
10 questions
Python basics

Quiz
•
12th Grade
12 questions
Python Unit 2 Quiz 2

Quiz
•
9th - 12th Grade
10 questions
Arrays

Quiz
•
10th - 12th Grade
7 questions
java podstawy

Quiz
•
9th Grade - University
8 questions
Robotics Quiz

Quiz
•
1st - 12th Grade
13 questions
Fundamentals of Python

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade