
CSC60A: Outcome 2/ WQ

Quiz
•
Computers
•
11th Grade
•
Easy
Ayesha Abdullah
Used 6+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
The code segment below is intended to calculate the circumference c of a circle with the diameter d of 1.5. The circumference of a circle is equal to its diameter timespi.
/* missing declarations */
c = pi * d;
Which of the following variable declarations are most appropriate to replace /* missing declarations */ in this code segment?
int pi = 3.14159;
int d = 1.5;
final int c;
final int pi = 3.14159;
int d = 1.5;
int c;
final double pi = 3.14159;
double d = 1.5;
double c;
double pi = 3.14159;
double d = 1.5;
final double c = 0.0;
final double pi = 3.14159;
final double d = 1.5;
final double c = 0.0;
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the following code segment.
int x = 5;
int y = 6;
/* missing code */
z = (x + y) / 2;
Which of the following can be used to replace /* missing code */ so that the code segment will compile?
I. int z = 0;
II. int z;
III. boolean z = false;
I only
II only
I and II only
II and III only
I, II and III
3.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
A code segment (not shown) is intended to determine the number of players whose average score in a game exceeds 0.5. A player’s average score is stored in avgScore, and the number of players who meet the criterion is stored in the variable count.
Which of the following pairs of declarations is most appropriate for the code segment described?
double avgScore;
boolean count;
double avgScore;
double count;
double avgScore;
int count;
int avgScore;
boolean count;
int avgScore;
int count;
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What type should you use to represent the number of people in a household?
int
String
Double
Boolean
Float
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What type should you use to represent the first name of a person?
int
String
Double
Boolean
Float
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What type should you use to record if it is raining or not?
int
String
Double
Boolean
Float
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What type should you use for a shoe size like 8.5?
int
String
Double
Boolean
Float
8.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following pairs of declarations are the most appropriate to store a student’s average course grade in the variable GPA and the number of students in the variable numStudents?
int GPA; int numStudents;
double GPA; int numStudents;
int GPA; double numStudents;
double GPA; double numStudents;
double GPA; boolean numStudents;
Similar Resources on Wayground
10 questions
AP CSA Unit 1 & 2 Review

Quiz
•
9th - 12th Grade
9 questions
C sharp

Quiz
•
11th Grade
10 questions
Intro to Python

Quiz
•
KG - University
12 questions
Java Code

Quiz
•
10th - 12th Grade
10 questions
Latihan Class Library

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

Quiz
•
9th - 12th Grade
11 questions
SK T4 : Tatasusunan

Quiz
•
11th - 12th Grade
11 questions
Java1

Quiz
•
6th - 11th Grade
Popular Resources on Wayground
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
ELA Advisory Review

Quiz
•
7th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns

Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade