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]
2 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]2 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
Dogs are great pets for families because they teach children many important life lessons. (2) A dog must be walked and fed at ce
PIT_PIT [208]

The answer is A on edge. A)Just like homework and other activities, helping to take care of a dog teaches a child about responsibility.

4 0
2 years ago
Read 2 more answers
John wants to know the amount of ram memory installed on his computer. in which category of the windows 7 control panel can this
Verizon [17]

John can find the amount of Random Access Memory (RAM) memory installed on his computer with the Windows 7 under the category “<u>System and Security</u>” in the Control Panel.

To know the total amount of installed RAM through Control Panel in the computer with Windows 7, John should follow the steps as:

  • Click the Windows key
  • Type Control Panel
  • Click the category named “System and Security”
  • Now under “System”, click “View amount of RAM and processor speed”
  • “Device Specifications” section displays the amount of installed RAM in John’s computer

Thus, above are the steps by which John’s can find the amount of installed RAM in his Windows 7 computer’s Control Panel.

What is Random Access Memory (RAM)?

RAM is the temporary memory in computers that stores the data currently being used by the processor.

You can learn more about Control Panel at

brainly.com/question/1445737

#SPJ4

5 0
1 year ago
What is the effect of this line of CSS code?
Semenov [28]
The correct answer is C
6 0
2 years ago
How is cropping different from scaling?​
Keith_Richards [23]

Answer:

Scaling changes the size of the whole image by resampling it(duplicating the pixels). in cropping you only get a part of the original image/ remove the outer area of it .

Explanation:

8 0
3 years ago
Universal Containers has a requirement to integrate Salesforce with an external system to control record access. What option sho
Inessa05 [86]

Answer:

C. Use the SOAP API to maintain the related SObject_share records

8 0
2 years ago
Other questions:
  • This question involves the implementation of the PasswordGenerator class, which generates strings containing initial passwords f
    5·1 answer
  • How was windows 3 installed on a pc?
    11·1 answer
  • Which type of software is the most similar to database software?\
    5·1 answer
  • Wide area network (WAN) connects multiple networks that are in the same geographical locations.
    6·1 answer
  • Could someone give an example or tell me what all of these mean? (For internet source citing) Evaluation: • Domain Name: • Autho
    7·1 answer
  • Justin has started a lawn mowing business in his neighborhood. He is running a weed-pulling special this month. What is the most
    8·2 answers
  • Two-dimensional random walk (20 points). A two-dimensional random walk simulates the behavior of a particle moving in a grid of
    14·1 answer
  • Please help!
    10·2 answers
  • Gus has decided to organize his inbox on June 26 by using folders and deleting irrelevant messages. He creates a folder called "
    12·2 answers
  • Role of User Defined Iprms for creation of paten
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!