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
dezoksy [38]
3 years ago
10

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(
Computers and Technology
1 answer:
Andrew [12]3 years ago
6 0

Answer:

import java.util.*;

public class Main

{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

   

    int[] arr = new int[5];

   

    System.out.println("Enter values for integer list: ");

    for (int i=0; i<5; i++){

        arr[i] = input.nextInt();

    }

   

    System.out.print("Enter the threshold: ");

    int t = input.nextInt();

   

    outputIntsLessThanOrEqualToThreshold(arr, t);

   

}

public static void outputIntsLessThanOrEqualToThreshold(int[] arr, int threshold){

   

    for (int x: arr){

        if (x<threshold)

            System.out.print(x + " ");

    }

}

}

Explanation:

Create a function called outputIntsLessThanOrEqualToThreshold that takes two parameters, arr and threshold

Check each element in the arr. If they are smaller than the threshold, print the element

Inside the main:

Initialize the array with user inputs and get the threshold value

Call the outputIntsLessThanOrEqualToThreshold function with the entered array numbers and threshold value

You might be interested in
I don't know what to do, anyone there?​
s2008m [1.1K]
I’m here, hello. . . . . . .
3 0
3 years ago
For a policy to become enforceable, it must meet five criteria, which are?
Karolina [17]

A policy must be distributed, evaluated, understood, consistent, and followed in order to be enforceable.

What is enforceable?

A legally enforceable right of set-off is one that is valid and recognized in all situations (ie enforceable both in the normal course of business and on the default, insolvency or bankruptcy of one of the counterparties).

Distribution denotes that the policy has been made accessible to all personnel for the evaluation process (through events or notification). The second condition defines the content's readability, taking into account the challenges faced by speakers of foreign languages and complex terms (using simple and precise wording to remove uncertainty).

Understanding the terms of the policy is tested through comprehension, and uniform application of the policy is assessed through consistency. Finally, compliance denotes agreement among all parties to abide by the rules.

Learn more about enforceable policy click here:

brainly.com/question/26984272

#SPJ1

8 0
2 years ago
Fill in the blank: In a Word chart, text that describes the data represented in a chart and that is typically displayed on the r
Triss [41]

Answer:

Data bar

Explanation:

8 0
3 years ago
(true or false) fortnite is the best?
GarryVolchara [31]

Answer:

FALSE ZzZzZzZz

Explanation:

Cus it is PERIOT

7 0
3 years ago
Read 2 more answers
How does the author of let bindi have the limelight persuade readers to consider the importance of wildlife conservation
kvasek [131]

Answer:

The answer is animal extinction.

Explanation:

Bind is considered to be an animal ambassador. The death of her father made her want to dedicate her career to animal conservation. She takes action, through business and performing to help conservation causes.

4 0
3 years ago
Read 2 more answers
Other questions:
  • If Maya wants to access a view that would control multiple slides within a presentation, which view should she utilize? Master v
    9·1 answer
  • Please I need all the help I can get Thank You So Much
    14·1 answer
  • What type of traffic always goes to all devices in a subnet?
    10·1 answer
  • Chandra, a student working on a group project, is trying to decide how to have the whole group suggest revisions for an essay. S
    10·1 answer
  • What can be said about the equipment used by photographers during the Civil War?
    13·2 answers
  • Match the parts of the software applications with what they do.
    15·1 answer
  • Why people shouldnt get married​
    6·1 answer
  • Sound technology has been influenced the most by the ___.
    5·2 answers
  • Large and powerful computer capable of processing and storing large amounts of business data
    5·1 answer
  • Apart from using secure networks, how else can Dhruv keep his deliverables safe in the office and on the go? Select all that app
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!