Variables and Data Types FRQ Practice

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

Question 1 of 5

A conservatory 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
occupiedBenches How many benches currently hold plants, a whole number from 0 through 36
leafWetness A leaf-wetness reading such as 0.42
nightMode Whether grow lights should stay off after dusk

Question 2 of 5

A teammate claims that GreenhouseBed is a primitive type because one of its properties, plantCount, is an int. Explain why GreenhouseBed is a reference type. State what a primitive variable stores compared with what a GreenhouseBed variable stores. Give one example of a value that belongs in a primitive variable rather than in a GreenhouseBed object.

Question 3 of 5

In AP CSA, a data type is more than a label. Define data type in terms of values and operations. Then classify String cultivarName as primitive or reference and classify boolean bloomOpen as primitive or reference. Explain each classification.

Question 4 of 5

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

dripMinutes: whole-number minutes the drip line has already run today. mixRatio: a fertilizer concentrate that may include a decimal. ventsSealed: whether the roof vents are fully closed.

Question 5 of 5

A student attempts the line humidityPercent; Identify what is missing from that attempted declaration. Then write a correct declaration for a fractional measurement named humidityPercent and a correct declaration for an integer named bloomCount. Do not give either variable an initial value.