Generate random numbers with Math.random() 1

On the AP Computer Science Exam, you will be expected to be familiar with Math.random. You may be asked to use it to generate a random value within a specific range, generate a random valid index in an array or list, or make a conditional statement true with a specific probability. The AP CS Elevens ...

Selection sort practice problem

Selection sort is an algorithm to arrange the elements of a data structure, such as an array or list, in increasing or decreasing order. The algorithm partitions the array into sorted and unsorted parts and repeatedly finds the minimum (or maximum) in the unsorted part and swaps it with the last element of the sorted ...

PirateParrot free response practice question 2

Inheritance and polymorphism is almost always tested in the multiple choice section and is occasionally featured in a free response question. The AP CS Elevens Lab features inheritance.