Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this part of the exam, you are to write a function called labw 1 0 Exam 2 . The function takes three arguments: an

For this part of the exam, you are to write a function called labw10Exam2.
The function takes three arguments:
an array of values
a number as input
option
the function should return two values counts and indicies
counts and indicies are both empty if the array of values is empty or if there are not three arguments provided, or if option is not 1,2,0.3 otherwise if option =1, counts should be the number of values in the input array that are less than the second parameter if option =2, counts should be the number of values in the input array that are equal to the second input parameter, if option =3 counts should be the number of values in the input array that are greater than the second input parameter. indicies should contain the indicies of the locations that matched the criteria specified by option.
It is expected that your code will use a loop of some sort and if-else statements.
If the input array was [36-190-1232-7-371114-3707-5-3244-40-27-41] and the second parameter was 0, and option was 3 then counts would be 6 and indicies would be [15891215]
If the input array was [, then scores and indicies would both equal []. parameter was -5, and option was 1, then counts would equal 8 and indicies would equal [23468111620]
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions