Skip to content
Marlbridge

AP® Computer Science A · Unit 1 · Topic 1.2

Variables and Data Types: Checklist (Computer Science A 1.2)

A self-check list for data types, int, double, boolean, String and variable declarations, linked to the guide sections and practice questions.

Work through the list without notes. If you cannot do a statement, follow its link, then come back. Guide = study guide; Practice = practice questions.

Understanding

  • I can define a data type as a set of values with the operations on them. (Guide: “Storing information needs a plan”)
  • I can sort types into primitive and reference, and name the three primitive types of the course. (Guide: the table of types; Practice Question 1)
  • I can explain that a variable has a name, a fixed type and a value that can change. (Guide: “Variables: named storage that can change”)
  • I can explain the difference between 4 and 4.0 and why they have different types. (Guide: “Why int and double are different”; Practice Question 5)
  • I can explain that a String variable holds a reference to an object because String is a class. (Guide: the table of types; Practice Question 1)

Skills

  • I can choose int, double, boolean or String for a described piece of data. (Guide: Worked example 1; Practice Questions 2 and 7)
  • I can write a declaration with and without an initial value, and later change the value without repeating the type. (Guide: “Declaring a variable”)
  • I can say whether a declaration compiles and, if not, state why. (Guide: Worked example 2; Practice Questions 3 and 8)
  • I can trace declarations and assignments in a table and state the printed output. (Practice Questions 4 and 9)
  • I can write valid variable names following Java’s rules. (Guide: “Naming rules and habits”; Practice Questions 3, 6 and 8)

Reasoning

  • I can explain why a double cannot be stored in an int variable but an int can be stored in a double. (Guide: “The compiler checks types”; Practice Question 3)
  • I can explain why double avg = 7 / 2; holds 3.0 and not 3.5. (Guide: Worked example 2; Practice Question 5)
  • I can explain that assigning one primitive variable to another copies the value, so later changes do not affect the copy. (Guide: Worked example 2; Practice Questions 4 and 9)

All ticked? Move on to the Topic 1.3 study guide, Expressions and Output, or return to the course roadmap.

AP® and Advanced Placement® are trademarks registered by the College Board, which is not affiliated with, and does not endorse, this website. Marlbridge is an independent tuition provider. It is not an authorized AP course provider, an AP school or an exam centre, and these resources are not official College Board materials. Reading them or doing simulations does not meet the laboratory requirement of an AP science course.