Search Header Logo

Ap computer 2

Authored by Oluwanifemi Elesinnla

Computers

8th - 9th Grade

Used 87+ times

Ap computer 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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)

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?