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
lesantik [10]
3 years ago
9

Write a program that continually prompts the user for an integer input until input is entered that is less than 0. Each input th

at is accepted is appended to an array named inputs, until an invalid input is given. When the first invalid input is entered the program prints the array and exists.
Computers and Technology
1 answer:
professor190 [17]3 years ago
7 0

Answer:

Following are the program in the C++ Programming Language:

#include <iostream>//header file

using namespace std;//namespane

//set main method

int main() {  

int a[100]; //set integer type array variable

int value, i = 0; //set integer variables

cout<<"Enter less than 0 to exit:"<<endl; //message for exit

cout<<"Enter the integer numbers:"<<endl; //message to enter numbers

do{ //set do while

cin>>value; //get input from the user

a[i++] = value; //append elements in array

}while(value>=0);

i--;  

cout<<"\nArray are:"<<endl;//message for array

for(int k = 0;k<i;k++){ //set for loop

cout<<a[k]<<" "; //print array

}

return 0;

}

<u>Output</u>:

Enter less than 0 to exit:

Enter the integer numbers:

1

2

3

4

5

-1

Array are:

1 2 3 4 5

Explanation:

Here, we set the integer data type main method "main()" and inside it:

  • we set integer type array variable with index value 100.
  • we set two integer type variable "value" and "i" initialize value 0.
  • we set the do-while loop in which we get the input from the user and and append in the array and pass condition if the value is greater then equal to 0.
  • Finally, set for loop and print the elements of an array.

 

You might be interested in
If my 98 dodge ram 1500 truck is dropping RPM's when i stop does that mean i need new throttle body sensors or does it mean i ne
geniusboy [140]
You might need a new 02 sensor and i really dont know about the vacuum leak.
6 0
3 years ago
Read 2 more answers
CHEGG Why does Akamai need to geographically disperse its servers to deliver its customers’ web content?
Wittaler [7]

Answer:

Find the explanation below.

Explanation:

Akamai is a cloud service and content delivery company that is known for providing web and internet security on a worldwide scale. To effectively discharge their services to their customers, they disperse different content such as videos and pictures in different servers based on the location of their site visitors. They do this in order to reduce the time wasted in loading pages.

Most online visitors are impatient when it comes to pages that load slowly. Spreading these servers across different locations would reduce traffic and thus increase the loading speed.

6 0
3 years ago
When using a template to compose a memorandum which key on the keyboard moves the cursor to the next field
marishachu [46]
The tab key moves the cursor to the next field in the tab order, which is set by the programmer.
8 0
3 years ago
Assume that the "read/write file to hard disk" library is part of the kernel. Assume that this library uses 1MB of RAM. Assume t
scZoUnD [109]

Answer:

The Answer is 1 MB.

Explanation:

In order to replace the library it must write 0 MB to hard drive then only it can be replaced. Therefore 1 MB is the correct answer.

5 0
4 years ago
Which is an example of a withholding you might see on your pay stub?
Arisa [49]
An example of a withholding you might see on your stub who'll be money.
3 0
3 years ago
Other questions:
  • What are three distractions that can prevent a driver from focusing on driving? Explain how a driver can prevent these distracti
    15·1 answer
  • How would you define the rule of thirds
    5·1 answer
  • Write a Java method onlyDigits that takes a string as a parameter. The method should remove from the string all characters, whic
    15·1 answer
  • The first step in the information processing cycle involves the _____ of data.
    10·1 answer
  • 1.Discuss the differences and similarities between a peer-to peer network and a client server network.
    8·1 answer
  • What is the iterative procedure of recursive and nonrecursive?
    10·1 answer
  • Which statement best describes the difference between a spreadsheet and a database?
    9·2 answers
  • Which of the following is an object such as a field which can be inserted into a document
    7·1 answer
  • Which option is the easiest way to configure macros in Access 2016?
    6·1 answer
  • Complete a flowchart and a Python program to calculate grade of a student based on marks using the following criteria:
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!