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
mote1985 [20]
3 years ago
15

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

the output is
50 60 75
Computers and Technology
1 answer:
Gre4nikov [31]3 years ago
7 0

Answer:

The program in Python is as follows:

num = int(input())

numList = []

for i in range(num+1):

   numInput = int(input())

   numList.append(numInput)

for i in range(len(numList)-1):

   if numList[i] <= numList[-1]:

       print(numList[i],end=" ")

Explanation:

This gets input for the number of integers

num = int(input())

This initializes an empty list

numList = []

This iterates through the number of integers and gets input for each

for i in range(num+1):

   numInput = int(input())

The inputs including the threshold are appended to the list

   numList.append(numInput)

This iterates through the list

for i in range(len(numList)-1):

All inputs less than or equal to the threshold are printed

   if numList[i] <= numList[-1]:

       print(numList[i],end=" ")

You might be interested in
You implement basic version control and go through the phase of creating a local repository. Initiate the commands to set up tha
notsponge [240]
Version control is the foundation of DevOps. Gain speed with Helix Core. Get the version control tools you need. Try today. Modern Collaboration. Increase Visibility.
3 0
3 years ago
What is computer software?​
Lady_Fox [76]

Answer:

Software is a collection of instructions that tell a computer how to work. This is in contrast to hardware, from which the system is built and actually performs the work.

3 0
2 years ago
Read 2 more answers
A list of sources used for in-text citations that appears at the end of a document is called:
jolli1 [7]
The correct answer is Works cited page
5 0
3 years ago
Write a repetition statement that outputs the numbers 45 , 51 , . . . , 165 . That is, all of the multiples of 6 in increasing o
Bingel [31]

Answer:

#include <iostream>

using namespace std;

int main()

{

   int i = 45;

   for ( i = 45; i <=165; i = i + 6)

       cout << i << endl;

}

Explanation:

I corrected your code and highlighted the mistakes. Even though you wrote the correct algorithm, your code did not compile because of the typos you made.

Remember, C++ is a case-sensitive language. That means, "For" is not same as "for".

Generally, variables and keywords are written in lower case. Of course, there are exceptions, such as constant variables are all written in uppercase letter and class names start with an uppercase letter.

8 0
3 years ago
What branch of science helps avoid or minimize stress-related injuries at workplace?
Vlada [557]

The answer is : Ergonomics.  This improvement process removes risk factors that lead to injuries and allows for improved human performance and productivity. Applying ergonomic solutions can make employees more comfortable and increase productivity. It is important because when doing a job and our body is stressed by an awkward posture, extreme temperature, or repeated movement your musculoskeletal system is affected.

7 0
3 years ago
Other questions:
  • What will be the output of the following Python code? class A: def test1(self): print(" test of A called ") class B(A): def test
    15·1 answer
  • How long does it take to wire a house?
    14·2 answers
  • Which of the following is true about driving on "bald" tires?
    5·1 answer
  • What steps might a company or organization need take in order to keep its digital data secure online?
    8·1 answer
  • What is the command to list the contents of directors in Unix- like operating system
    10·1 answer
  • Help easy 50 points!!!!<br> How do i make someone be the brianliest? No crown thing is appering!!!!
    10·2 answers
  • . Write a C++ Code to get a multiline statement Str1 from a user with a ‘$’ as return character (Hint:
    6·1 answer
  • Some applications required advanced storage solutions are available to provide fault tolerance and high performance.
    13·1 answer
  • Please list 15 safety rules that you think should be practiced in the Computer Technology classroom/lab.
    12·1 answer
  • 2.Some artists look for ways to extend copyright for longer than the laws normally allow. Why do they do this?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!