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
wariber [46]
3 years ago
14

5.20 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. Ex: If the input is: 5 50 60 140 200 75 100 the output is: 50,60,75,
Computers and Technology
1 answer:
Sveta_85 [38]3 years ago
6 0

Answer:

Following are the code to the given question:

x= input()#defining a variable x that inputs value from the user-end

l = x.split(" ")#defining variable l that splits the x variable value with a space

t= int(l[len(l)- 1])#defining a variable t that decrease the l length and convert the value into integer

for i in range(1, (len(l) - 1)):#use for loop to calculate the range of the list

      if int(l[i]) < t:#defining if block that checks the list value is lessthan t

          print(l[i])#print list values

Output:

Please find the attached file.

Explanation:

In the above-given code, an "x" variable is declared that inputs the value from the user-end, and use the "l" variable that splits all the value and defined a "t" variable that adds value into the list and convert the value into an integer.

In the next step, for loop is declared that counts the lists and use a conditional statement that checks list value is less than t and use the print the method that prints the list values.  

You might be interested in
Choose the answer that best completes the
Fiesta28 [93]

Answer:

the information processing cycle

Explanation:

3 0
2 years ago
Read 2 more answers
1.Which of the serves as the basis for determining whether an object has moved or not?
Harrizon [31]

Answer:

1. b

2. c

3. b

4. d

5. a

(hope this helped)

4 0
2 years ago
The parallax perspective says that objects that are close up appear to move __________ than far away objects.
serious [3.7K]

Answer:

It appears to move faster.

5 0
3 years ago
ABC company have lots of computer running window 7. But they are not thinking to upgrade a higher version of window. One of the
Alexxx [7]

First threat

  • It's malware
  • Because chrome OS is not much secure as compare to windows 11 (Prime opponent)

2nd threat

  • It's speed
  • Chrome OS is litreally very slow .
  • On comparing to windows edition it lacks in multiple factor so you work per unit tike decreases

Third threat

  • You may be able to use Android apps but windows is made for Computers
  • In several factors like ads,cleanness chrome OS will create problems
5 0
1 year ago
Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have alre
Fudgin [204]

Answer:

The c++ program to implement the while loop is given below.

#include <iostream>

using namespace std;

int main() {

  // declaration of integer variables

   int k, n, total;

   // initialization of integer variables

   k=1, n=4, total=0;

//  loop executed till value of k becomes equal to value of n

   while( k <= n ){

       // cube of every integer is added to the variable total

       total = total + ( k * k * k );

       // value of k is incremented to go to the next number

k = k + 1 ;

   }  

   return 0;

}  

Explanation:

The program begins with the declaration of integer variables.  

int k, n, total;

This is followed by initialization of these variables.

k=1, n=4, total=0;

The while loop runs over the variable k which is initialized to 1. The loop runs till value of k reaches the value of integer n.

First, cube of k is computed and added to the variable total.

After first execution of the loop, total is initialized to the cube of 1.

Next, value of variable k is incremented by 1 so that k is initialized to next integer.

After first execution of the loop, k is incremented from 1 to 2.

while( k <= n )

{

total = total + ( k * k * k );

k = k + 1 ;

   }

When the value of k reaches the value of integer n, the cube of n is calculated and added to the variable, total.

When k is incremented, it becomes more than n and hence, loop gets terminated.

As the return type of main is int, the program terminates with the statement shown below.

return 0;

No output is displayed as it is not mentioned in the question.

No user input is taken as it is mentioned that integer variables are already initialized.

4 0
3 years ago
Other questions:
  • Does anyone have any social media message me
    14·1 answer
  • What new information, strategies, or techniques have you learned that will increase your technology skills? Explain why its impo
    7·1 answer
  • What are dividends? AA small part, or share, of a company. BA type of savings account that grows over time. CA distribution of a
    5·1 answer
  • A software license gives the owner the to use software.
    12·2 answers
  • What is the function of the command prompt?
    8·1 answer
  • According to your​ reading, Macy's uses​ ________ technology to track individual items for sale on store shelves.
    5·2 answers
  • A cpu handless all the instruction that it recieces from hard ware and software which are available on the computer true or fals
    7·1 answer
  • Presentation graphics programs contain an assortment of tools and operations for creating and editing slides, including preforma
    8·2 answers
  • Which of the following has the greatest impact on telecommunications design?
    12·2 answers
  • Why optical disk is slower than magnetic disk.?​
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!