answer.
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
masha68 [24]
1 year 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 less 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. For coding simplicity, follow every output value by a space, including the last one. Such functionality is common on sites like Amazon, where a user can filter results.
Computers and Technology
1 answer:
Naya [18.7K]1 year ago
4 0

Answer:

The program to this question as follows:

Program:

#include<iostream> //include header file.

using namespace std; //using name space.

int main() //main function.

{

int n,i,key; //define variable.

int a[n]; //define array

cout<<"Enter size of array :"; //message.

cin>>n; //input number from user.

cout<<"Enter array elements :"; //message

for(i = 0;i<n;i++) //loop

{

cin>>a[i]; //input array elements

}

cout<<"Enter a number:"; //message

cin>>key; //input number.

for(i = 0;i<n;i++) //loop

{

if(a[i]<=key) //if block

{

cout<<a[i]<<"\n "; //print array elements

}

}

return 0;

}

Output:

Enter size of array :7

Enter array elements :5

50

50

75

100

200

140

Enter a number:100

5

50

50

75

100

Explanation:

The description of the above program as follows:

  • In this program first, we include a header file and define the main method in method we define variables and array that are "n, i, key and a[]". In this function, all variable data type is "integer".
  • The variable n is used for the size of array and variable i use in the loop and the key variable is used for comparing array elements. Then we use an array that is "a[]" in the array, we use the for loop to insert elements form user input.  
  • Then we define a loop that uses a conditional statement in if block we check that array elements is less than and equal to a key variable. If this value is true so, we will print the remaining elements.  

You might be interested in
Elaine is upset with her group members because she wanted to lead the group but is not allowed to. She found that other group me
11111nata11111 [884]
The stage the group is in is forming
6 0
1 year ago
Read 2 more answers
Which are technical and visual demands that need to be considered when planning a project? Choose three answers
iren [92.7K]

Answer: Resolution or DPI, deliverables, and file types are important technical and visual demands to consider when planning a project.

Explanation: Keep in mind whether or not the project will be published in print or on the Web.

4 0
1 year ago
Which of the following is an advantage of inserting a page number field in your document rather than inserting each page number
Artyom0805 [142]

The advantage of inserting the page number field is that the page number field could show the current page number.

The following information should be relevant with respect to the page number:

  • The page number field & the actual page number should be formatted.
  • The page number field & the actual page number both could be inserted into the header or footer.
  • The page number field & the actual page number could be easily inserted into the document.

Therefore we can conclude that the advantage of inserting the page number field is that the page number field could show the current page number.

Learn more about the page number here: brainly.com/question/3063419

8 0
1 year ago
Where does an MPLS label go in a PDU?
Natalija [7]

Answer: Between Layers 2 and 3

Explanation:

In between Layer 2 and Layer 3 the MPLS header is present and is known as Shim header. It is also said to be in 2.5.

6 0
1 year ago
PLEASE HELP PROGRAMMING WILL GIVE BRAINLIEST
JulijaS [17]
The fourth choice is correct.
5 0
2 years ago
Other questions:
  • A two-dimensional array can have elements of ________ data type(s).
    7·1 answer
  • Isabel is creating a wireframe. She has drawn a layout for the home page along with outlining the navigation elements. She now w
    15·2 answers
  • . Write a recursive function names factorial to compute the factorial of the parameter. Also write the main function, where you
    15·1 answer
  • Robert needs to apply formatting from one set of text to multiple other sets of text throughout the document. Which option shoul
    7·1 answer
  • The icacls.exe command adds __________, which are visible by clicking the Advanced button in the folder Properties dialog box
    15·1 answer
  • A company wants to publish Knowledge articles to its Customer Community. The articles should be organized for easy navigation by
    6·1 answer
  • Nicole wants to create a database to collect information about videos in her video rental store. She would like to use the datab
    9·1 answer
  • Design a program that asks the user for a series of names (in no particular order). After the final person’s name has been enter
    5·1 answer
  • Write a method called printRangeOfNumbers that accepts a minimum, maximum numbers as parameters and prints each number from mini
    6·1 answer
  • A shop will give discount of 10% if the cost of purchased quantity is more than 1000. Ask user for quantity suppose, one unit wi
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!