Skip to content
Marlbridge

AP® Computer Science A · Unit 1 · Topic 1.11

Math Class: Checklist (Computer Science A 1.11)

A self-check list for the Math class methods abs, pow, sqrt and random and for generating random numbers in a given range, 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 say that Math is in java.lang, needs no import and contains only class methods. (Guide: “A toolbox of mathematical class methods”; Practice Question 1)
  • I can state the return type of abs (both versions), pow, sqrt and random. (Guide: the table of methods; Practice Questions 2 and 3)
  • I can state the range of Math.random() and which end is inclusive. (Guide: “Random numbers from Math.random”)
  • I can explain what inclusive and exclusive ends of a range mean. (Guide: “Random numbers from Math.random”; Practice Question 10)

Skills

  • I can evaluate expressions that combine abs, pow and sqrt and give the value and type. (Guide: Worked example 1; Practice Questions 2, 3 and 4)
  • I can write a random int expression for a given inclusive range using scale, cast and shift. (Guide: Worked example 2; Practice Questions 5 and 8)
  • I can write a random double expression for a given range. (Guide: “The general recipe”; Practice Question 8)
  • I can work out the possible range of a given random expression. (Practice Question 6)
  • I can write a class method that uses Math methods. (Practice Question 9)

Reasoning

  • I can test a random expression by trying the smallest and largest possible values. (Guide: Worked example 2; Practice Questions 8 and 10)
  • I can explain why (int) Math.random() * 6 is always 0. (Guide: “Common misconceptions”; Practice Question 7)
  • I can explain why the multiplier is the count of values, not the upper end. (Guide: “The general recipe”; Practice Questions 5 and 6)

All ticked? Move on to the Topic 1.12 study guide, Objects: Instances of Classes, 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.