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
vredina [299]
3 years ago
12

Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer

s 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
Computers and Technology
1 answer:
Rainbow [258]3 years ago
8 0

Answer:

Explanation:

The following is coded in Java. It asks the user for the number of inputs and then creates a loop to read all of the inputs and adds them to an ArrayList. Then it saves the last value in the array as the threshold. Finally, it loops through the array printing only the values less than or equal to the threshold. The program has been tested and the output can be seen in the image below.

import java.util.ArrayList;

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       ArrayList<Integer> myList = new ArrayList<>();

       System.out.println("How many inputs will you add? ");

       int inputs = in.nextInt();

       System.out.println("Enter inputs: ");

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

           int num = in.nextInt();

           myList.add(num);

       }

       int threshold = myList.get(myList.size()-1);

       System.out.println("Inputs Less than or Equal to Threshold: ");

       for (int x: myList) {

           if (x <= threshold) {

               System.out.println(x);

           }

       }

   }

}

You might be interested in
Help me please. i need you help​
Fudgin [204]

Answer:

Can you provide the code

7 0
3 years ago
At a local marketing firm, Steve is the lead Web developer and is responsible for working with customers on their Web designs, d
attashe74 [19]

Answer:

All of the above.

Explanation:

Understanding that he must create a unique domain name for each client

Being able to work with HTML

Understanding of the World Wide Web and how hyperlinks work

All of these would be a critical skill Steve must have to be able to perform his job.

6 0
4 years ago
Difference between server and a client computer
maw [93]

Answer:

A server stores data for a client computer to access and use, and pretty self eplanitory for a client computer

Explanation:

5 0
3 years ago
A database can be used to manage which of the following for a website?
Oliga [24]
Images would probably be the best choice here
7 0
3 years ago
18. The push rod connects to the _______, which is designed to pivot back and forth to open and close the valve.
spin [16.1K]
In an overhead valve engine, pushrods connect to A. rocker arm which pivots and opens valves
6 0
3 years ago
Read 2 more answers
Other questions:
  • What type of socket should be used with an air impact wrench
    12·1 answer
  • It proceeds the statement causes execution of the current loop iteration to end and commence at the beginning of the next loop.
    10·1 answer
  • Which job role requires you to create user guides for computer products and services?
    13·2 answers
  • Which camera mode gives the photographer the greatest amount of control?
    7·2 answers
  • An F-1 ____________ may be authorized by the DSO to participate in a curricular practical training program that is an__________
    8·1 answer
  • Which of the following is not a type of bank?
    5·2 answers
  • Power delivered to the hitch of tractors is called
    12·1 answer
  • Very Short Answer Type Question (any 9)
    12·1 answer
  • Que se encarga de notar lo que pasa alrededor
    8·1 answer
  • STOP DELETING MY ANSWERS AND QUESTIONS!!!!!!!
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!