CSC60A: Outcome 2/ WQ

CSC60A: Outcome 2/ WQ

11th Grade

8 Qs

quiz-placeholder

Similar activities

CodeHS 2.5 Casting

CodeHS 2.5 Casting

9th - 12th Grade

10 Qs

Java Basics #1

Java Basics #1

10th - 12th Grade

9 Qs

CS2 Review

CS2 Review

9th - 12th Grade

12 Qs

Kuiz 3.1 Persekitaran Kod Arahan dan Jenis Data

Kuiz 3.1 Persekitaran Kod Arahan dan Jenis Data

1st - 12th Grade

10 Qs

Arrays Intro

Arrays Intro

9th - 12th Grade

12 Qs

MICROSOFT EXCEL

MICROSOFT EXCEL

9th - 11th Grade

10 Qs

Data Type Review

Data Type Review

KG - Professional Development

12 Qs

APCSA Scanner Input

APCSA Scanner Input

9th - 12th Grade

12 Qs

CSC60A: Outcome 2/ WQ

CSC60A: Outcome 2/ WQ

Assessment

Quiz

Computers

11th Grade

Easy

Created by

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;

Discover more resources for Computers