Question: 1 1 . 3 3 LAB: User - Defined Functions: Output values below an amount Define a function named outputIntsLessThanOrEqualToThreshold that takes two parameters: an

11.33 LAB: User-Defined Functions: Output values below an amount
Define a function named outputIntsLessThanOrEqualToThreshold that takes two parameters: an array of integers and an integer representing a threshold value. Function outputIntsLessThanOrEqualToThreshold() outputs all integers in the array that are less than or equal to the threshold value.
Write a main program that reads six integers from input. The first five values are stored in an array. The last value is the upper threshold. Then the program calls function outputIntsLessThanOrEqualToThreshold() with the array and threshold as arguments. Function outputIntsLessThanOrEqualToThreshold() will output the results.
Ex: If the input is:
506014020075100
where 50,60,140,200, and 75 are values in an array. 100 is the threshold value. The output is:
506075
For coding simplicity, follow every output value by a space, including the last one.
Your program should define and use a function:
Function outputIntsLessThanOrEqualToThreshold(integer array(?) userVals, integer upperThreshold) returns nothing
Such functionality is common on sites like Amazon, where a user can filter results.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!