Summary: Ap Computer Science Principles

Study material generic cover image
  • This + 400k other summaries
  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Use this summary
Remember faster, study better. Scientifically proven.
Trustpilot Logo

Read the summary and the most important questions on AP Computer Science Principles

  • 1 Learning Goal 1 (Lessons 1-4)

    This is a preview. There are 23 more flashcards available for chapter 1
    Show more cards here

  • What is the syntax for reassigning values stored in a list?

    The syntax for reassigning values stored in a list is identical to that used when reassigning variables. Even the ++ notation to increase a value by one works!
    • myArray[2] = myArray[2] + 1;
    • myArray[8]++;
  • What expression can be used to access the last element in any list?

    We can use this expression to access the last element in any list: myArray[myArray.length - 1]
  • What command is used to add a new item to the end of a list?

    The simplest way to do this is to add a new item to the end of your list using the appendItem command.
  • How are lists indexed?

    Lists are zero-indexed, which means that the first index is 0.
  • What does it mean to append an item to a list?

    To append means to add something at the end of the list (think: “append at the end”).
  • What is the purpose of the insertItem function?

    If you want to add elements in the middle of your list you can use insertItem to specify an index at which an item should be inserted.
    • insertItem(list, index, item);
  • What are some examples of using expressions as indexes?

    Here are some examples:
    • myArray[2+3];
    • myArray[randomNumber(1,10)];
    • myArray[x+2];
  • How does appending an item affect the size of the list?

    When you append an item to a list you actually add a new location to the end of the list that contains the new value, so that the total size of the list grows by one.
  • How does the removeItem function work?

    Sometimes we want to remove something from a list. In order to do so you'll need to specify the index of the item that should be removed.
    • removeItem(list, index);
  • What is the index of the first item in a JavaScript list?

    In JavaScript, the first index is 0.

To read further, please click:

Read the full summary
This summary +380.000 other summaries A unique study tool A rehearsal system for this summary Studycoaching with videos
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart