Questions 55-57 refer to the following code. count - 1 pets ["dog", "dogfood", "cat", "catfood", "fish"] FOR EACH animal IN pats ( } IF (animal "fish") { DISPLAY (animal) INSERT (pets, count, fishfood") } count count 1 55. What will the code display? (A) dog, dogfood, cat, catfood, fish (B) dog, dogfood, cat, catfood, fish, fishfood (C) fish, fishfood (D) fish 56. What is the length of the list "pets" after the code runs? (A) 4 (B) 5 (C) 6 (D) 7 7. What is value of pets[3] after the following code is run? INSERT (pets, 1, "horse") INSERT (pets, 2, "carrots") REMOVE (pets, 3) (A) It is an empty field. (B) dog (C) dogfood (D) cat

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter3: Performing Calculations With Formulas And Functions
Section: Chapter Questions
Problem 3.9CP
icon
Related questions
Question
Please answer this questions and show the work and explain how you got the answer!
Questions 55-57 refer to the following code.
count - 1
pets
["dog", "dogfood", "cat",
"catfood", "fish"]
FOR EACH animal IN pats
(
IF (animal = "fish")
{
DISPLAY (animal)
INSERT (pets, count, fishfood")
}
count count + 1
}
55. What will the code display?
(A) dog, dogfood, cat, catfood, fish
(B) dog, dogfood, cat, catfood, fish, fishfood
(C) fish, fishfood
(D) fish
(A) 4
(B) 5
(C) 6
(D) 7
56. What is the length of the list "pets" after the
code runs?
$7. What is value of pets[3] after the following code
is run?
INSERT (pets, 1, "horse")
INSERT (pets, 2, "carrots")
REMOVE (pets, 3)
(A) It is an empty field.
(B) dog
(C) dogfood
(D) cat
Transcribed Image Text:Questions 55-57 refer to the following code. count - 1 pets ["dog", "dogfood", "cat", "catfood", "fish"] FOR EACH animal IN pats ( IF (animal = "fish") { DISPLAY (animal) INSERT (pets, count, fishfood") } count count + 1 } 55. What will the code display? (A) dog, dogfood, cat, catfood, fish (B) dog, dogfood, cat, catfood, fish, fishfood (C) fish, fishfood (D) fish (A) 4 (B) 5 (C) 6 (D) 7 56. What is the length of the list "pets" after the code runs? $7. What is value of pets[3] after the following code is run? INSERT (pets, 1, "horse") INSERT (pets, 2, "carrots") REMOVE (pets, 3) (A) It is an empty field. (B) dog (C) dogfood (D) cat
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Introduction to Template
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage