3.1 Hacks

File 1(3.1 Video 1)

  1. Answer: #1 numApples, integer
  2. Answer: #3 isCold, boolean
  3. Answer: #1 IDNumber, string
  4. Answer: #2, No
  5. Answer: #1, Boolean
  6. Answer: #4, An integer can be changed with addition and subtraction and a string is a set number or string of letters.

Additional Questions

  1. Which of the following data types is best for storing a word? A. String B. Boolean C. Integer D. List

  2. How would you store the result of a presidential vote in a program? A. presVotes, string B. votesforpresident, integer C. presVotes, integer D. presVotes, boolean

Answer: C.

  1. How would store a value that contains whether a user has a premium subscription? A. usersubscription, boolean B. proSub, boolean C. doyouhavesubscription, string D. subbed, integer

Answer: D.

File 2(3.1 Video 2)

  1. Answer: #3, 7
  2. Answer: #2, 10
  3. Answer: #4, 6 6
  4. Answer: #2, 30 30 25
  5. Answer: #2, 20
  6. Answer: #3, The value of first is true, and the value of second is true.
  7. Answer: #1, 21 40 30 50

Additional Questions

  1. What is displayed by the code? string <– “hello” string <– “bye” string <– greeting DISPLAY (greeting)

A. "bye" B. “hello” C. greeting D. string

  1. What is displayed by the code? a <– 2 b <– a b <– 10 a <– b DISPLAY (a)

A. 10 B. 2 C. a D. b

  1. What boolean value will be stored in the variable enoughMoney? enoughMoney <– true value <– false enoughMoney <– value coupon <– true enoughMoney <– coupon

A. false B. enoughMoney C. true D. coupon

  1. What will be the result of the code? x <– 40 y <– 2 z <– 18 z <– x/y y <– x + z

DISPLAY (x + y + z)

A. 20 B. 40 C. 60 D. 120

  1. What will be displayed by the code segment? account <– 100 account <– account * 1.1 expenses <– 20 account <– account - expenses DISPLAY (account)

A. 20 B. 100 C. 90 D. 110

  1. What will the code segment display? studentA <– ‘A’ studentB <– studentA studentF <– ‘A+’ studentA <– studentF DISPLAY (studentA)

A. 'A+' B. ‘A’ C. studentF D. ‘C-‘

Blog

3.1 Focused on variables and assigning values to those variables. Variables will hold value throughout the program. When naming a variable, it is important to make it simple and not too long, for ease of use and calling in a program. We can store different types of values in the variable, like an integer, string, boolean, or float. When calling variable, the value stored in the variable will be the same as the most recent definition of the variable above the call. I think it is important to practice questions with lots of reassignment because theses questions can become very confusing quickly if you do not pay attention while going through the pseudocode.

3.2 Hacks

Video 2

Binary Hacks

Binary to Decimal

  1. 7
  2. 11
  3. 107 Decimal to Binary
  4. 1100
  5. 101100
  6. 11111110

    Extra Binary Hacks

    Decimal to Binary

  7. 1110000000000001
  8. 111111111111111111111111
  9. 101010101010101010101010 Binary to Decimal
  10. 2794
  11. 1248
  12. 53800

Hacks

  1. Answer: #4 [92, 79, 97, 63]
  2. Answer: #1 [“Sam”, “Ann”]
  3. Answer: #3 6
  4. Answer: #4 5
  5. Answer: #4 All of the above.(Boolean, String, Float)
  6. Answer: #2 -106.2
  7. Answer: #3 16
  8. Answer: #2 False
  9. Answer: #6 1 and 4

Blog

Lists are very important to programs and algorithms. They allow for any data set to be stored together. Lists can take in any data type. Lists store these elements at specific indices. When counting the indices of a list, the first one starts at 0, the second one is 1, the third one is 2, etc. It is important to know what a list can store for AP questions.