1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Black_prince [1.1K]
3 years ago
6

A summer camp offers a morning session and an afternoon session. The list morningList contains the names of all children attendi

ng the morning session, and the list afternoonList contains the names of all children attending the afternoon session.
Only children who attend both sessions eat lunch at the camp. The camp director wants to create lunchList, which will contain the names of children attending both sessions.
The following code segment is intended to create lunchList, which is initially empty.

It uses the procedure IsFound (list, name), which returns true if name is found in list and returns false otherwise.



FOR EACH child IN morningList

{



}

Which of the following could replace so that the code segment works as intended?
(A)
IF (IsFound (afternoonList, child))

{

APPEND (lunchList, child)

}

(B)
IF (IsFound (lunchList, child))

{

APPEND (afternoonList, child)

}
(C)
IF (IsFound (morningList, child))

{

APPEND (lunchList, child)

}

(D)
IF ((IsFound (morningList, child)) OR

(IsFound (afternoonList, child)))

{

APPEND (lunchList, child)

}
Computers and Technology
1 answer:
juin [17]3 years ago
3 0

Answer:

The answer is "Option A".

Explanation:

In this question, the choice "A" is correct because in this a conditional if block statement is used that that use "IsFound" method that takes two parameters "afternoonList and Child" in its parameter and use the append method that takes "lunchList and child" in parameter and add values, that's why other choices are wrong.

You might be interested in
Who is the intended audience of a pseudocode document?
cluponka [151]

Answer and Example:

Pseudocode is an artificial and informal language that helps programmers develop algorithms.

Pseudocode is a "text-based" detail (algorithmic) design tool. The rules of Pseudocode are reasonably straightforward. All statements showing "dependency" are to be indented.

Pseudocode is understood by the programmers of all types. it enables the programmer to concentrate only on the algorithm part of the code development.

Java would use this.

3 0
3 years ago
ACTIVITY NI MATCHING TYPE Directions: Match Column A with Column B. Write the letter of the correct answer on the space provided
Korvikt [17]

Answer:

Mark me a brainless plss i need that i am blink plss

6 0
3 years ago
Why is it important to know much time you spend on task
crimeas [40]
The answer is a) <span>so you can provide enough time studying. </span>
8 0
3 years ago
# q7 - create function readFileFirstLast() to meet the conditions below
MAVERICK [17]

Answer:

See explaination

Explanation:

def readFileFirstLast(filename):

# doc string

''' Function accept the filename and opens the fle

and reads all lines and strips new line character and

stores first and last in a string and return that string'''

#eception handle if file not found

try:

#opening the file

f = open(filename)

#reading the first line and striping the ne line

string = f.readline().strip()

#iterating until last line

for line in f:

pass

#concate the last line after strip the new line character to the string

string = string + " " + line.strip()

#return the string

return string

except:

#if file not found

return "File not found"

#taking the file name from user

filename = input("Enter a file name: ")

#printing the doc string in function

print("\ndoc_sting: \n"+ readFileFirstLast.__doc__+"\n")

#printing the returned string by calling the readFileFirstLast()

print("output string :")

print(readFileFirstLast(filename))

3 0
3 years ago
According to your​ reading, Macy's uses​ ________ technology to track individual items for sale on store shelves.
Setler79 [48]
She uses the Radio-frequency identification(RFID) which is a technology that uses electromagnetic fields to automatically identify and track tags attached to objects.These tags contain electronically-stored information.the passive tags collect energy from a nearby RFID readers interrogating radio waves.They contain an integrated circuit and an antenna which are used to transmit data to the RFID reader also called an interrogator.
8 0
3 years ago
Read 2 more answers
Other questions:
  • What is the opening page of a website called?
    9·2 answers
  • Which computer is the best for video cutting?
    11·2 answers
  • A server that provides data transfer and storage space at remote locations is called a
    7·1 answer
  • Write a paper, 2-3 paragraphs that discuss how to defend ideas objectively through effective communication. Include the skills n
    6·1 answer
  • Which is the first thing that would happen if a plant could NOT obtain carbon dioxide? A It would not be able to reproduce. B It
    5·1 answer
  • 2. Given the following list, write a snippet of code that would print the individual elements of the list using the indexes of t
    13·1 answer
  • Consumer consequences for illegally downloading software
    6·1 answer
  • The higher the ____________________, the faster the ____________________.
    5·1 answer
  • Who is your favorite person from squid game?
    13·2 answers
  • How is video compression accomplished?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!