Help! AP Computer Science Principles
30. What is a major disadvantage of the internet's model of trust? (A) A trusted website can have a large amount of power over a computer, so improper trusts can be very damaging if the website is malicious. (B) A trusted website has power over the computer's ROM, which could be very damaging if the website is malicious. (C) A trusted website cannot have encrypted communications, which means any data sent can be read by an interceptor. (D) A trusted website can still download malicious code even if it is blocked by a firewall. 31. The program below will return TRUE if the last digit of a is equal to the last digit of b. Example: if a = 34 and b = 94 the program will return true. if a = 11 and b = 35 the program will return false. if a = 6 and b = 86 the program will return true. Which code below can replace
so the procedure would return TRUE? Line 1: PROCEDURE lastDigit (a, b) Line 2: { Line 3: Line 4: RETURN (true) Line 5: ELSE Line 6: RETURN (false) Line 7:} (A) IF (a = b) (B) IF (a /10 = b/10) (C) IF (a != b) (D) IF (a MOD 10 = b MOD 10) 32. The Caesar cipher is an encryption technique that is a substitution cipher replacing a letter with a different letter with a fixed number of positions down the alphabet. For example, of a shift of 3 the message "cat" would translate to "fdw." The Caesar cipher is an example of what type of encryption? (A) Asymmetric encryption (B) Public key encryption (C) Home key encryption (D) No key encryption 33. A web browser contacts a domain name system (DNS) server using IPv4 and pages a request for a website's address. Which of the following could NOT be a potential response? (A) 92.11.198.113 (B) 174.260.45.144 (C) 128.198.232.65 (D) 54.116.188.246 34. What is the average number of searches required if using a linear search on a list containing 2000 numbers? (A) 2000 (B) 1000 (C) 11 (D) 1 35. What will the following program display? FOR EACH item IN listi listi 1, 35. 76, -4, 98 list 2 - 5, 1, 8, 6, 96, list3 - 0 DISPLAY ( mystery (listi, list2, list3 )) Procedure mystery (listi, list2, list 3) FOR EACH item IN listi IF Is Found (list2, item) APPEND list3, item RETURN (list 3) (A) (B) (1,6,-4) (C)[4, 6,-4) (D) (1, 35, 6, 76, 4, 98, 5, 1, 8, 96,-4] 36. What is the value of sum displayed after this algorithm is run? listi 85, 5, 40, 79, 80, 92, 20 sum FOR EACH item In listi IF item MOD 2 = 0 sum sum + 1 DISPLAY (sum (A) O (B) 4 (C) 6 (D) Error 37. What will the following program display? y-2 DISPLAY ( mystery (x, y)) PROCEDURE mystery REPEAT UNTIL x = 0 DISPLAY("0") X-X-1 REPEAT UNTIL Y = 0 DISPLAY("X) Yay (A) OXXOXXOXX (B) OXXOO (C) 000OXXX (D) The program is an infinite loop