Variables and Data Types FRQ Practice

Responses receive AI feedback against a rubric after submission. Scores are practice estimates.

Question 1 of 5

A campus radio program must represent the three quantities in the table. For each quantity, name the most appropriate AP CSA type: int, double, boolean, or a reference type. Justify each choice in one sentence.

Quantity Specification
trackNumber The current compact-disc track as a whole number
fadeSeconds Crossfade length such as 1.5
callerWaiting Whether someone is holding on the request line

Question 2 of 5

A producer says ShowClock must be primitive because it contains an int named hour. Explain why ShowClock is still a reference type. State what a ShowClock variable stores. Contrast that with what hour would store if hour were declared as a separate primitive variable.

Question 3 of 5

Classify each of the following as primitive or reference and justify the classification: (1) String djHandle, used for an on-air name stored as an object; (2) double signalStrength, used for a possibly fractional transmitter reading; (3) StudioLog, an object that combines several fields about one broadcast hour.

Question 4 of 5

Write valid Java declarations, without giving any variable an initial value, for the following radio-booth quantities. Use each of int, double, and boolean exactly once, and include a semicolon on each line.

spotCount: whole-number advertisements remaining in the hour. boardGain: a fader setting that may include a decimal. dumpArmed: whether the delay-dump switch is armed.

Question 5 of 5

A student writes double isStereo; because the identifier describes a yes-or-no property of the audio feed. Explain why the identifier does not make this a Boolean variable. Write the corrected Boolean declaration for isStereo without giving it an initial value. State the two values permitted by the corrected type.