Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Christopher is writing a checkNumas procedure that takes in a list of numbers and checks whether every number on the list is greater than 1
Christopher is writing a checkNumas procedure that takes in a list of numbers and checks whether every number on the list is greater than If it is the procedure should retum tr procedure should return false.
He wrote the following code:
PROCEDURE checkNums numList
FOR EACH num IN numList
IF num
i
RETURN false
ELSE
i
RETURN true
Explain in clear, complete sentences why this code will not work as intended.
What will display when the following code segment is executed?
scores larr
totallarr
FOR EACH score IN scores
i
f num is
totallarr total score
DISPLAY totai
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started