Computers and Technology

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 ?
answer choices
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)

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 18:00, MagicDragon4734
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
image
Computers and Technology, 24.06.2019 16:00, bsrlee1115
Which type of cloud computing offers easily accessible software and applications on the machines
Answers: 1
image
Computers and Technology, 25.06.2019 01:30, jeff6284
Ashort circuit locator should be periodically run along the cords used in a shop to check for shorts and open circuits. a.)true b.)false
Answers: 2
image
Computers and Technology, 25.06.2019 05:50, jonmorton159
Acolor class has three public, integer-returning accessor methods: getred, getgreen, and getblue, and three protected, void-returning mutator methods: setred, setgreen, setblue, each of which accepts an integer parameter and assigns it to the corresponding color component. the class, alphachannelcolor-- a subclass of color-- has an integer instance variable, alpha, containing the alpha channel value, representing the degree of transparency of the color. alphachannelcolor also has a method named dissolve (void-returning, and no parameters), that causes the color to fade a bit. it does this by incrementing (by 1) all three color components (using the above accessor and mutator methods) as well as the alpha component value. write the dissolve method.
Answers: 2
Do you know the correct answer?
Consider two lists of numbers called list1 and list2. A programmer wants to determine how many diffe...

Questions in other subjects:

Konu
English, 06.12.2021 23:40
Konu
Mathematics, 06.12.2021 23:40