Ap computer 2

Ap computer 2

8th - 9th Grade

9 Qs

quiz-placeholder

Similar activities

Code.org CSA

Code.org CSA

9th - 12th Grade

8 Qs

APCSA Unit 7

APCSA Unit 7

9th - 12th Grade

8 Qs

AP CSP Unit 7

AP CSP Unit 7

9th - 12th Grade

8 Qs

Python List Comprehension Review

Python List Comprehension Review

9th - 12th Grade

10 Qs

Списки Python + Pygame

Списки Python + Pygame

KG - University

10 Qs

String Methods

String Methods

9th - 12th Grade

10 Qs

Python-List

Python-List

8th Grade

10 Qs

Computer Science Principles

Computer Science Principles

9th - 12th Grade

8 Qs

Ap computer 2

Ap computer 2

Assessment

Quiz

Computers

8th - 9th Grade

Hard

Created by

Oluwanifemi Elesinnla

Used 86+ times

FREE Resource

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

The transmission control protocol (TCP) and Internet protocol (IP) are used in Internet communication. Which of the following best describes the purpose of these protocols?

To ensure that communications between devices on the Internet are above a minimum transmission speed

To ensure that private data is inaccessible to unauthorized devices on the Internet

To establish a common standard for sending messages between devices on the Internet

To validate the ownership of encryption keys used in Internet communication

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

The following procedure is intended to return true if at least two of the three parameters are equal in value and is intended to return false otherwise.

PROCEDURE AnyPairs (x, y, z)

{

IF (x = y)

{

RETURN (true)

}

ELSE

{

RETURN (y = z)

}

}

For which of the following procedure calls does the procedure NOT return the intended value?

(A) AnyPairs ("bat", "cat", "rat")

AnyPairs ("bat", "bat", "rat")

AnyPairs ("bat", "cat", "bat")

AnyPairs ("bat", "cat", "cat")

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Which of the following is NOT an advantage of using open-source software?

Open-source software is generally free or lower in cost than commercially available software.

The availability of source code makes it possible to customize open-source software to a user’s individual needs.

The original developer of open-source software provides free or low-cost support for users installing and running the software.

Unlike commercial software, which can become obsolete when the company that created it goes out of business, open-source software can be updated without the involvement of the original programmers.

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Consider two lists of numbers called list1 and list2. A programmer wants to determine how many different values appear in both lists. For example, if list1 contains

[10, 10, 20, 30, 40, 50, 60] and list2 contains [20, 20, 40, 60, 80], then there are three different values that appear in both lists (20, 40, and 60).


The programmer has the following procedures available.

Procedure Call Explanation

Combine (myList1, myList2) This procedure creates a new list containing the elements from myList1 followed by the entries from myList2. The resulting

list is returned. For example, if myList1 contains [2, 4, 6] and

myList2 contains [1, 5], the procedure will return the list

[2, 4, 6, 1, 5].

RemoveAllDups (myList) This procedure creates a new list containing the elements of myList with any duplicate values removed. The resulting list is returned. For

example, if myList contains [3, 2, 4, 2, 2, 5, 6, 4],

the procedure will return the list [3, 2, 4, 5, 6].

Which of the following can be used to assign the intended value to count ?

bothList ← Combine (list1, list2)

uniqueList ← RemoveAllDups (bothList)

count ← LENGTH (bothList) - LENGTH (uniqueList)

newList1 ← RemoveAllDups (list1)

newList2 ← RemoveAllDups (list2)

bothList ← Combine (newList1, newList2)

count ← LENGTH (list1) + LENGTH (list2) - LENGTH (bothList)

newList1 ← RemoveAllDups (list1)

newList2 ← RemoveAllDups (list2)

bothList ← Combine (newList1, newList2)

count ← LENGTH (newList1) + LENGTH (newList2) - LENGTH (bothList)

newList1 ← RemoveAllDups (list1)

newList2 ← RemoveAllDups (list2)

bothList ← Combine (newList1, newList2)

uniqueList ← RemoveAllDups (bothList)

count ← LENGTH (bothList) - LENGTH (uniqueList)

5.

MULTIPLE SELECT QUESTION

2 mins • 1 pt

Which of the following actions are likely to be helpful in reducing the digital divide?

Select two answers

Designing new technologies intended only for advanced users

Designing new technologies to be accessible to individuals with different physical abilities

Implementing government regulations restricting citizens’ access to Web content

Having world governments support the construction of network infrastructure

6.

MULTIPLE SELECT QUESTION

2 mins • 1 pt

A bookstore has a database containing information about each book for sale in the store. A sample portion of the database is shown below.


Author Title Selling Price Genre Quantity Available J. M. Barrie Peter and Wendy $6.99 Fantasy 3 L. Frank Baum The Wonderful Wizard of Oz $7.99 Fantasy 2 Arthur Conan Doyle The Hound of the Baskervilles $7.49 Mystery 4 Mary Shelley Frankenstein $7.99 Horror 4 Jules Verne Twenty Thousand Leagues Under the Sea $6.99 Science Fiction 3 H. G. Wells The War of the Worlds $4.99 Science Fiction 3

A store employee wants to calculate the total amount of money the store will receive if they sell all of the available science fiction books. Which columns in the database can be ignored and still allow the employee to perform this calculation?

Select two answers.

Author

Title

Genre

Quantity Available

7.

MULTIPLE SELECT QUESTION

2 mins • 1 pt

A program contains the following procedures for string manipulation.


Procedure Call Explanation

Concat (str1, str2) Returns a single string consisting of str1 followed by str2. For example, Concat ("key", "board") returns "keyboard".

Substring (str, start, length) Returns a substring of consecutive characters from str, starting with the character at position start and containing length characters.

The first character of str is located at position 1. For example,

Substring ("delivery", 3, 4) returns "live".


Which of the following can be used to store the string "jackalope" in the string variable animal ? Select two answers.

animal ← Substring ("antelope", 5, 4)

animal ← Concat (animal, "a")

animal ← Concat (Substring ("jackrabbit", 1, 4), animal)

animal ← Substring ("antelope", 5, 4)

animal ← Concat ("a", animal)

animal ← Concat (Substring ("jackrabbit", 1, 4), animal)

animal ← Substring ("jackrabbit", 1, 4)

animal ← Concat (animal, "a")

animal ← Concat (animal, Substring ("antelope", 5, 4))

animal ← Substring ("jackrabbit", 1, 4)

animal ← Concat (animal, "a")

animal ← Concat (Substring ("antelope", 5, 4), animal)

8.

MULTIPLE SELECT QUESTION

2 mins • 1 pt

Which of the following are examples of DDoS attacks?


Select two answers.

A coordinated group of devices sends thousands of simultaneous requests to an online store in an attempt to make it difficult for customers to complete their purchases.

E-mails are sent to many users who use a Web-based document-editing program. Each e-mail appears to be an invitation to share a document, but is actually a request for permission to access the user’s account.

A hacking group, using thousands of bots, sends an overwhelming number of payment requests to a donation site in an attempt to disrupt services over a dispute about how customers’ donations are being handled.

Thousands of e-mail messages are sent to targeted companies, appearing to come from different addresses, in the hope that the receivers will click the links embedded in messages.

9.

MULTIPLE SELECT QUESTION

2 mins • 1 pt

In mathematics, a perfect number is a type of integer. The procedure IsPerfect (num) returns true if num is a perfect number and returns false otherwise.


The following program is intended to count and display the number of perfect numbers between the integers start and end, inclusive. Assume that start is less than end. The program does not work as intended.

Line 1: currentNum ← start

Line 2: count ← 0

Line 3: REPEAT UNTIL (currentNum > end)

Line 4: {

Line 5: count ← count + 1

Line 6: IF (IsPerfect (currentNum))

Line 7: {

Line 8: count ← count + 1

Line 9: currentNum ← currentNum + 1

Line 10: }

Line 11: currentNum ← currentNum + 1

Line 12: }

Line 13: DISPLAY (count)

Which two lines of code should be removed so that the program will work as intended?

Select two answers.

Line 5

Line 8

Line 9

Line 11