Unit 3 Study Guide 1

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

3.7 AP-Style MC Practice: If our list called List is populated as [0, 1, 2, 3, 4], what happens if our code tries to access List [5] per the rules of the AP Computer Science Principles Reference Guide?

The output will be 4

3.8 AP-Style MC Practice: Daija is creating a budget, and evaluating his purchases over the last month. Consider the following code segment which attempts to find the sum of all purchases made in the last month, stored in purchaseList. What code can replace missing code to assign the total of all values in purchaseList to sum?

III only

3.1 AP-Style MC Practice: Which of the following questions cannot be easily answered using a binary set of answers?

Which is the best song new song from last year?

3.9 AP-Style MC Practice: A program is used to print name tags for guests at an event. Unfortunately for each guest it prints the last name before the first name when the opposite is desired. The procedure for printing the name tags uses the variables FN for the first name and LN for last name. Which of the following code segments, inserted in the correct place in the procedure will cause the program to print the name tags in the desired way?

Temp ← LN LN ← FN FN ← Temp

3.8 AP-Style MC Practice: The code below and accompanying table will output a number which represents which of the following:

The average of grades above 79.

Unit 3, Quiz 1: A city engineer is tasked with studying vehicular traffic patterns throughout a large metropolitan area. He designs a number of small, remote devices that can be installed along streets throughout the city to sense and record the hundreds of cars that pass through each of the city's five busiest intersections during a 24-hour period. Every time a car trips the sensor in a device, it increments an internal, 5-bit counter that stores the number of cars that have passed through the intersection since the counter was last reset. Every 24 hours, each device transmits the 5-bit value stored in its counter back to a central server that collects the daily data from all of the devices throughout the city. After transmitting, the counter in each device is reset back to 0. Fortunately, the engineer's supervisor points out a flaw in the device's design and orders that the engineer modify the design specifications for this device before building and installing the sensors. Which of the following is most likely the design flaw in this scenario?

The counter is not capable of counting hundreds of cars without exceeding the limit of the five bits of storage.

3.1 AP-Style MC Practice: Which of the following can be represented by a single binary digit?

The direction of travel for an elevator

3.9 AP-Style MC Practice: A teacher uses the following program to adjust student grades on an assignment by adding 5 points to each student's original grade. However, if adding 5 points to a student's original grade causes the grade to exceed 100 points, the student will receive the maximum possible score of 100 points. The students' original grades are stored in the list gradeList, which is indexed from 1 to n.

first choice: gradeList [i] ← gradeList[i] + 5 IF (gradeList [i] > 100) { gradeList [i] ← 100 } second choice: gradeList [i] ← min (gradeList[i] + 5, 100)

3.9 AP-Style MC Practice: Sometimes we care about the order of a list, and need to reorder the items according to a condition (alphabetical, numerical, etc). An algorithm finds the minimum value in the list and swaps it with the value in the first position, then repeats these steps for the remainder of the list, swapping with the second position, then the third position and so forth. What type of sorting is this?

selection

Unit 3, Quiz 1: There is a base 6 number system that uses symbols instead of numerals to represent different values. Below is the symbol that represents each numeral. ⤲ = 0 ↺ = 1 ➣ = 2 ⬳ = 3 ⤴ = 4 ⇶ = 5 Which of the following numbers written using this base 6 number system is equivalent to the base 10 number 147?

⤴ ⤲ ⬳

3.2 AP-Style MC Practice: What is the binary equivalent to the decimal number of 78?

1001110

3.2 AP-Style MC Practice: Which of the following decimal values, when converted to binary (ignore leading zeros) have exactly 3 zeros in them? Select two answers.

50 20

3.10 AP-Style MC Practice: The procedure below is intended to return true if a particular city name (cityName) appears more than once in a list of cities (cityList), and false if it does not appear, or only appears once in the list. Which of the following statements about the testing of this procedure is true?

Calling the procedure CityRepeat (["New York", "Los Angeles" "New York", "Chicago"], "Boston") shows that the procedure does not work as intended in this case.

3.3 AP-Style MC Practice: Using the table given below, determine the ASCII to binary code conversion for the word science.

01110011 01100011 01101001 01100101 01101110 01100011 01100101

3.3 AP-Style MC Practice: ASCII is a common format for the representation of characters in writing code. How many characters can be represented in the standard ASCII encoding?

2^7

3.3 AP-Style MC Practice: The following steps can be used to encode a string of text using Base64 encoding: 1. Convert the ASCII characters to their corresponding decimal value 2. Convert the decimal values to their 8-bit equivalents 3. Join all of the bits together to form one continuous string 4. Split the combined string into groups of 6 bits 5. From left to right, convert each group of 6 bits to their corresponding decimal values 6. Convert those decimal values back to the corresponding Base64 values If I started with the three ASCII characters "CSP", how many Base64 values will I be left with at the end?

4

Unit 3, Quiz 1: ASCII is a character-encoding scheme that uses 7 bits (8 bits if you are using the extended ASCII table) to represent each character. The decimal (base 10) values 65 through 90 represent the capital letters A through Z, as shown in the table below: Which ASCII character is represented by the binary (base 2) number 1000001?

A

3.1 AP-Style MC Practice: Which of the following statements about 32-bit binary values is NOT true?

All real numbers within a finite interval can be expressed by a 32-bit integer representation.

3.10 AP-Style MC Practice: The code segment below uses the procedure IsPartOf (list, item), which returns true if item appears in list and returns false otherwise. The list newList is initially empty. Which of the following best describes the contents of newList after the code segment is executed?

All unique elements in oldList NOT including any repeats of elements.

3.8 AP-Style MC Practice: The county clerk's office is writing a program to search their database for citizen records based on information about that citizen such as first name, last name, age, etc. Given below is a segment of pseudocode that should find the record of every citizen over the age of 50 in the county. The code makes use of the functions GetAgeOf and GetNameOf, which are used to retrieve the age and name of a citizen from a record which is inputted. There is a mistake in this pseudocode. Which of the following is the correct pseudocode to find the records of all citizens over the age of 50.

IF(age > 50)

Big Picture: Reselling Digital Music - AP-Style MC Practice: As movies and music have moved into the digital world, the legal protections that relate to them have had to continually evolve. Which of the following best describes how the legal landscape regarding the digital movies and music has changed?

The music and movie industries have chosen to protect their copyrights by filing lawsuits against people who share digital files without permission.

Unit 3, Quiz 1: Which statements below are true about fixed and variable width encoding? Select two answers.

Variable width encoding must use extra bits to specify where characters start/end. Fixed width encodings are typically longer than variable width encodings.

3.10 AP-Style MC Practice: Based on the code below, what would be the best phrase to replace missing output?

You have an even amount of items in your list!

3.10 AP-Style MC Practice: A programmer has two lists of random words, list1 and list2. He has written a program that is intended to create a list, finalList, of all the words found in list1 and list2 in alphabetical order with no repeated words. His program makes use of the following procedures: Alphabetize(list) Returns a list that contains the elements of list in alphabetical order. Join (list 1, list2) Returns a list with the elements of list1 followed by the elements of list2 RemoveDuplicates (list) Returns a list with the same elements in the same order as list, but with any duplicate elements removed. The programmer's program is as follows:

finalList, will contain all the words found in list1 and list2 in alphabetical order, but it may contain repeated words.

3.10 AP-Style MC Practice: While running this code segment, the user enters the following values when prompted: pizza yes bread no. What is stored in the list called grocery after the block of code is executed?

milk, bread, pizza, eggs, cheese


Set pelajaran terkait

Chapter 4 - Learning About Careers

View Set

basic vehicle technologies 2:safety

View Set

Chapter 14 - Prioritization, Delegation, and Assignment

View Set

Chapter 1 - Chapter 10 Statistics

View Set

ISM Module two and three (study this one)

View Set

Napoleon Video Questions Parts 3 and 4

View Set

AP Lit Unit 7: Explain the function of character. Quiz

View Set