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
Kipish [7]
4 years ago
9

5.15 LAB: Output values below an amount 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 The 5 indicates that there are five integers in the list, namely 50, 60, 140, 200, and 75. The 100 indicates that the program should output all integers less than or equal to 100, so the program outputs 50, 60, and 75.

Computers and Technology
2 answers:
qaws [65]4 years ago
7 0

Answer:

def output_ints_less_than_or_equal_to_threshold(user_values, upper_threshold):

 for value in user_values:

     if value < upper_threshold:

         print(value)  

def get_user_values():

 n = int(input())

 lst = []

 for i in range(n):

     lst.append(int(input()))

 return lst  

if __name__ == '__main__':

 userValues = get_user_values()

 upperThreshold = int(input())

 output_ints_less_than_or_equal_to_threshold(userValues, upperThreshold)

Explanation:

IgorC [24]4 years ago
5 0

Answer:

# the terminal display waiting for the user to enter the input

# the received input is assigned to user_input

user_input = input()

# the user_input is splitted based on space and is assigned to integerlist

integerlist = user_input.split(" ")

# the last element in the integerlist is assigned as threshold

threshold = int(integerlist[len(integerlist) - 1])

# a for loop that loop from index 1 to second to the last element in the list

# the loop compare each element with the threshold

# if element is less than threshold, it is displayed

# the loop start from index 1 because index 0 represent number of element

for i in range(1, (len(integerlist) - 1)):

       if int(integerlist[i]) < threshold:

           print(integerlist[i], sep="")

Explanation:

The program is written in Python and well commented.

An sample of program output when it is executed is attached.

You might be interested in
Jason is an aspiring filmmaker. He manages finance and makes sure that everyone is involved in the project. Which role is Jason
lana66690 [7]

Answer:

a film producer.

is the role he is playing

7 0
3 years ago
In order to estimate the percentage of defects in a recent manufacturing batch, a quality control manager at Intel selects every
Bezzdna [24]

Answer:

systematic sampling method

Explanation:

Based on the information provided within the question it can be said that in this scenario the method that was used was a systematic sampling method. This method focuses on selecting elements from a ordered sampling frame, which in this case refers to every 8th chip starting from the 3rd. This method repeats once the end of the list or process is reached which is 140 chips in this scenario.

7 0
3 years ago
define the physical components of hardware for a computer system,including identifying internal hardware devices(e.g. processor,
kap26 [50]

Answer:

Explanation:

The necessary hardware components that a computer requires to run properly are the following.

Motherboard, this is the main circuit board that interconnects all of the components and allows them to interact with each other.

CPU, this is the brain of the computer where all calculations and processes are handled.

Video Card, this component handles all the visual data, rendering that the computer needs in order to get a proper image.

RAM, these components are the physical memory where temporary data is stored and used.

Hard Disk, this is the main storage drive where all your data will be saved including the operating system.

PSU, this is the power supply of the unit that distributes the correct amount of power to every other component in the system.

Sound Card, this component handles all the input and ouput audio signals for a computer.

7 0
3 years ago
How do you understand a scientific problem? Give two (2) examples of a scientific problem you
Brums [2.3K]

Answer:

i need free points im sry

Explanation:

8 0
3 years ago
The most common cause of foodborne illness is
nignag [31]

Answer:

Food posioning

Explanation:

8 0
4 years ago
Read 2 more answers
Other questions:
  • a. Is there any functional difference between the class being instantiated in the following two ways? Balanced bal = new Balance
    15·1 answer
  • Select the strategies below that are likely to increase audience attention.
    14·2 answers
  • Which is an example of appropiate online behavior?
    6·1 answer
  • Which of these network connections would allow your smartphone to sync your photos to your online account? Choose all that apply
    8·1 answer
  • PLEASE HELP FAST
    5·1 answer
  • Given the three thread states: running, runnable (i.e., ready), and blocked (i.e., waiting), state which of the six possible thr
    13·1 answer
  • Please help! In your own words explain the difference between a problem and an algorithm.
    13·2 answers
  • If the signal is going through a 2 MHz Bandwidth Channel, what will be the maximum bit rate that can be achieved in this channel
    14·1 answer
  • A 90-minute film is based on a fictional couple. They are very happy throughout the entire film. The film shows how they met, wh
    5·2 answers
  • During the first six months of his job, Enrique's boss gave him weekly feedback about his performance. What component of effecti
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!