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
lana [24]
3 years ago
11

Read integers from input and store each integer into a vector until -1 is read. Do not store -1 into the vector. Then, output al

l values in the vector (except the last value) with the last value in the vector subtracted from each value. Output each value on a new line. Ex: If the input is -46 66 76 9 -1, the output is:
-55
57
67
Computers and Technology
1 answer:
weqwewe [10]3 years ago
6 0

Answer:

The program in C++ is as follows:

#include <iostream>

#include <vector>

using namespace std;

int main(){

vector<int> nums;

int num;

cin>>num;

while(num != -1){

 nums.push_back(num);

 cin>>num; }  

for (auto i = nums.begin(); i != nums.end(); ++i){

    cout << *i <<endl; }

return 0;

}

Explanation:

This declares the vector

vector<int> nums;

This declares an integer variable for each input

int num;

This gets the first input

cin>>num;

This loop is repeated until user enters -1

while(num != -1){

Saves user input into the vector

 nums.push_back(num);

Get another input from the user

 cin>>num; }

The following iteration print the vector elements

<em> for (auto i = nums.begin(); i != nums.end(); ++i){ </em>

<em>     cout << *i <<endl; } </em>

You might be interested in
What should be done on a tablet in order for that tablet to cease all network connections?
ankoles [38]

Answer:

Turn On Airplane Mode

Explanation:

Turning off cellular does not turn off wifi.

Turning off wifi does not turn off cellular.

Turning off location services does not affect your network connections.

Airplane mode is what turns off all network connections.

3 0
3 years ago
To ensure that the original value of an argument passed to a method remains unchanged after returning from the method, you shoul
lakkis [162]

Answer:

false

Explanation:

A reference parameter passed into the method can be changed by the method, when the method changes all of a parameter's variables, the parameter will keep the changes after the method is returned.

4 0
3 years ago
How to show neither precious nor accurate
ella [17]
When it is shining it is precious. When it is normal it is accurate.











Please make as brainliest please please
8 0
3 years ago
Drag the tiles to the correct boxes to complete the pairs.
jek_recluse [69]

Answer:

1. Multistage database.

2. Stationary database.

3. Virtual database.

4. Distributed database.

Explanation:

A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to create, store, modify, retrieve and manage data or informations in a database. Generally, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.

There are four (4) major types of database in a data warehouse and these are;

1. <u>Multistage database</u>: used for concise as well as detailed historical data. It provides summarized data which can be used by an employee for short-term decision making.

2. <u>Stationary database</u>: used where access to data is rare i.e business firms who do not access data frequently. In order to use this database, the users must have an access to metadata store and thus, directly having access to the data on a source system.

3. <u>Virtual database</u>: used for accessing data in diverse applications using middleware. This type of database is dependent on having access to information on various databases.

4. <u>Distributed database</u>: used by an organization that runs several businesses. Therefore, this type of database are usually located or situated in various geographical regions.

5 0
2 years ago
'sampling is necessary under certain conditions' explain​
Andre45 [30]

Answer:

In these conditions sampling becomes necessary or convenient as it allows data collection within time limit and with less efforts.

6 0
3 years ago
Other questions:
  • A(n) __________ is a set of technologies used for exchanging data between applications and for connecting processes with other s
    14·2 answers
  • Why it’s important to keep the standard internet protocol TCP/IP?
    11·1 answer
  • Estimating the cost of a network is ______ complex than estimating the cost of onenew piece of data processing hardware.a.much m
    5·1 answer
  • sara has just started using the Internet. She would like to be more efficient . In 3-4, give sara some advice about how to be mo
    5·1 answer
  • Which is true about lists and stacks?
    8·1 answer
  • Write a C class, Flower, that has three member variables of type string, int, and float, which respectively represent the name o
    12·1 answer
  • Please help ASAP!
    15·1 answer
  • User defined blocks of code can be created in
    13·1 answer
  • ¿como la imagen organiza la realidad?
    13·1 answer
  • The full meaning of UNIVAC and ENIAC​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!