Question

*Coral Language* Write a program that first gets a list of six integers from input. The first five values are the intege...

*Coral Language*

Write a program that first gets a list of six integers from input. The first five values are the integer list. The last value is the upper threshold. Then output all integers less than or equal to the threshold value.

Ex: If the input is 50 60 140 200 75 100, the output is:

50 60 75

For coding simplicity, follow every output value by a space, including the last one.

Such functionality is common on sites like Amazon, where a user can filter results.

Your program should define and use a function:

Function outputIntsLessThanOrEqualToThreshold(integer array(?) userVals, integer upperThreshold) returns nothing
1 0
Add a comment Improve this question Transcribed image text
✔ Recommended Answer
Answer #1

If you have any doubts, please give me comment...

1 Function outputIntsLessThanOrEqualToThreshold(integer array(5) userVals, integer upperThreshold) returns nothing integer i

Function outputIntsLessThanOrEqualToThreshold(integer array(5) userVals, integer upperThreshold) returns nothing
integer i
for i=0; i<userVals.size; i = i + 1
if userVals[i]<upperThreshold
Put userVals[i] to output
Put " " to output

Function Main() returns nothing
integer array(5) userVals
integer threshold
integer i
for i = 0; i < userVals.size; i = i + 1
userVals[i] = Get next input
threshold = Get next input
outputIntsLessThanOrEqualToThreshold(userVals, threshold)

Add a comment
Know the answer?
Add Answer to:
*Coral Language* Write a program that first gets a list of six integers from input. The first five values are the intege...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Coral Language Please to thanks Write a program that first gets a list of 5 integers...

    Coral Language Please to thanks Write a program that first gets a list of 5 integers from input. Then, get another value from the input, and output all integers less than or equal to that value. Ex: If the input is 50 60 140 200 75 100, the output is: 50 60 75 For coding simplicity, follow every output value by a space, including the last one. Then, output a newline. Such functionality is common on sites like Amazon, where...

  • IN JAVA Write a program that first gets a list of integers from input. The input...

    IN JAVA Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, which indicates a threshold. Output all integers less than or equal to that last threshold value. Assume that the list will always contain fewer than 20 integers. Ex: If the input is: 5 50 60 140 200 75 100 the output is: 50 60 75...

  • Write a program that first gets a list of integers from the input and adds them...

    Write a program that first gets a list of integers from the input and adds them to an array. The input begins with an integer indicating the number of integers that follow (Your program should work for any size of the array). Then, get the last value from the input, and output all integers less than or equal to that value by iterating through the array. Ex: If the input is: Enter the number of integers: 5 Enter integer 1:...

  • Write a program that first gets a list of integers from input. The input begins with...

    Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, and output all integers less than or equal to that value. Ex: If the input is: 5 50 60 140 200 75 100 the output is: 50 60 75 The 5 indicates that there are five integers in the list, namely 50, 60, 140, 200, and 75....

  • Please draw a flow chart for each method please and thank you. Write a program that...

    Please draw a flow chart for each method please and thank you. Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, and output all integers less than or equal to that value. Assume that the list will always contain less than 20 integers. Ex: If the input is: 5 50 60 140 200 75 100 the...

  • NEED IN CORAL LANGUAGE ONLY When analyzing data sets, such as data for human heights or...

    NEED IN CORAL LANGUAGE ONLY When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by subtracting the smallest value from all the values. The input consists of five integers. Ex: If the input is 30 50 10 70 65, the output is: 20 40 0...

  • Write a program whose input is two integers, and whose output is the first integer

    5.20 (Ch 5) HW: Output range with increment of 10 Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer Ex: If the input is: -15 30 Then the output is: 15 -5 5 15 25 Ex: If the second integer is less than the first as in 20 5, the output is: Second integer can't be less than the...

  • 3.16 LAB: Output range with increment of 10 Write a program whose input is two integers,...

    3.16 LAB: Output range with increment of 10 Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer. Ex: If the input is: -15 30 the output is: -15 -5 5 15 25 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than...

  • in coral. Statistics are often calculated with varying amounts of input data. Write a program that...

    in coral. Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outputs the average and max. A negative integer ends the input and is not included in the statistics. Ex: When the input is 15 20 0 5 -1, the output is: 10 20 You can assume that at least one non-negative integer is input.

  • 5.21 LAB: Adjust values in a list by normalizing

    When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers.Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, adjust each integer in the list by subtracting the smallest value from all the integers.Ex: If the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT