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
olga nikolaevna [1]
2 years ago
5

Write a program that first reads a list of 5 integers from input. Then, read another value from the input, and output all intege

rs less than or equal to that last 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 a user can filter results. coral language, please
Computers and Technology
2 answers:
Makovka662 [10]2 years ago
8 0

Using the knowledge in python it is possible to write a code that uses the given values ​​to write its divisors.

<h3>Writing code in python:</h3>

<em>integer i</em>

<em>integer threshold</em>

<em>integer array(5) data</em>

<em>for i = 0; i < data.size; i = i + 1</em>

<em>   data[50, 60, 140, 200, 75, 100] = Get next input</em>

<em>threshold = Get next input</em>

<em>for i = 0; i < data.size; i = i + 1</em>

<em>   if data[50, 60, 140, 200, 75, 100] </em>

 

See more about python at brainly.com/question/18502436

#SPJ1

oksian1 [2.3K]2 years ago
6 0

Answer:

take user input element of list and print element of list whose value  are less than equal to last value of list

<u>Image 1: Input</u>

def output_ints_less_than_or_equal_to_threshold(user_values, upper_threshold):

      print("The integers that are less than or equal to", upper_threshold, "are:")

      for value in user_values:

             if value < upper_threshold:

                    print(value)

def get_user_values():

      n = int(input("Enter the number of integers in your list: ");

      1st = []

      print("Enter the", n, "integers:");

      for i in range(n):

             1st.append(int(input)

      return ist

if _name__ == '_main_':

userValues = get_user_values();

upperThreshold = int(userValues[-11), output ints less than or equal to threshold(userValues, upperThreshold)

<u>Image 1: Output</u>

Enter the number of integers in your list: 3 Enter the 3 integers:

10

50

20

The integers that are less than or equal to 20 are:

10

You might be interested in
Which service uses a broadband connection?
Sidana [21]

Answer:

d

Explanation:

because all in one question form

5 0
3 years ago
In 1981, Ian Murphy broke into the AT&amp;T online computer system and changed their clocks, allowing people to make calls durin
poizon [28]
A. intentionally or recklessly disrupt, degrade, or destroy information or services on the computer
5 0
2 years ago
Suppose that you are asked to modify the Stack class to add a new operation max() that returns the current maximum of the stack
Advocard [28]

Answer:

Following are the code to the given points:

Explanation:

For point 8.1:

public String max()//defining a method max

{

   String maxVal=null;//defining a string variable that holds a value

   for(int x=0;x<n;x++)

   {

       if(maxVal==null || a[i].compareTo(maxVal)>0)//defining if blok to comare the value

       {

           maxVal=a[i];//holding value in maxVal variable

       }

   }

   return maxVal;//return maxVal variable value

}

For point 8.2:

public void push(String item)//defining a method push that accepts item value in a parameter

{

       a[n]=item;//defining an array to hold item value

       if(n==0 || item.compareTo(maxVals[n-1])>0)//use if to comare item value

       {

               maxVals[n]=item;//holding item value in maxVals variable

       }

       else

       {

               maxVals[n]=maxVals[n-1];//decreasing the maxVals value

       }

       n++;//incrementing n value

}

public String pop()//defining a method pop

{

       return a[--n];//use return value

}

public String max()//defining a method max

{

       return maxVals[n-1];//return max value

}

  • In the first point, the max method is declared that compares the string and returns its max value.
  • In the second point, the push, pop, and max method are declared that works with their respective names like insert, remove and find max and after that, they return its value.
7 0
3 years ago
What are some ways you can work with templates? Check all that apply.
yaroslaw [1]
What are some ways you can work with templates? Check all that apply.

Answer: (A,D,E) see picture below for help also.

7 0
3 years ago
Read 2 more answers
When an attacker presents a program or himself as someone else to obtain private information and pretends to be a legitimate web
timofeeve [1]
A spoofing attack. "<span>a situation in which one person or program successfully masquerades as another by falsifying data, thereby gaining an illegitimate advantage."</span>
8 0
3 years ago
Other questions:
  • Attention merchants define
    5·1 answer
  • Which of the following describes a BYOD?
    15·1 answer
  • To what are multiple servers arranged in racks related
    14·2 answers
  • Lucy wants to develop a web page to display her profile. She wants to just start with a basic page that lists her accomplishment
    13·1 answer
  • In Microsoft word you can access the blank command from the mini toolbar
    7·1 answer
  • Which of the following is not an element of the modified block style?
    7·2 answers
  • An information system interacts with its environment by: A. processing data. B. XML protocols. C. receiving data. D. systems ana
    10·1 answer
  • Discuss All control statements supported by Go
    13·1 answer
  • Outline the dangers arising as a result of using computers​
    12·1 answer
  • Which website offers guidance on putting together a checklist to provide guidance on configuring and hardening operating systems
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!