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
In what scenario should dhcp servers also be active dhcp clients?
mrs_skeptik [129]
DHCP stands for Dynamic Host Configuration Protocol. It is protocol responsible for c<span>onfiguring the IP address and other TCP/IP settings on network computers. </span>There is no scenario in which DHCP servers also be active DHCP clients. They should never be both a DHCP server and DHCP client. The two sides (client and server) should be always separated.
4 0
3 years ago
In a computer-controlled greenhouse, a temperature sensor and a window motor are connected to the computer.
GrogVix [38]
Hope this helps solve it

8 0
3 years ago
What is ABC computer?​
mezya [45]

Answer: The Atanasoff–Berry computer was the first automatic electronic digital computer. Limited by the technology of the day, and execution, the device has remained somewhat obscure. The ABC's priority is debated among historians of computer technology, because it was neither programmable, nor Turing-complete.

Explanation:

5 0
3 years ago
: Show that the propositions (p ∨ q) ∧ (¬p ∨ r) and (p ∧ r) ⊕ (¬p ∧ q) are logically equivalent.
Ipatiy [6.2K]

Answer:

(p\vee q)\wedge(\neg p\vee r)\equiv(p\wedge r)\vee(\neg p\wedge q)

Explanation:

The statements are logically equivalent if they have the same truth tables. So let´s use truth tables in order to determine if they are logically equivalent or not:

The picture that I attached you shows the truth table for each case. As you can see in the highlight columns:

(p\vee q)\wedge(\neg p\vee r)\equiv(p\wedge r)\vee(\neg p\wedge q)

They are  logically equivalent because they have exactly the same truth values between each other. Hence, we can conclude that they are logically equivalent.

3 0
3 years ago
GuardIN is an IT security firm. It deals with highly secure data for a wide variety of software and e-commerce agreements, trade
jeka57 [31]

Answer:

GuardIN is an IT security firm. It deals with highly secure data for a wide variety of software and e-commerce agreements, trademark licenses, and patent licenses. GuardIN needs a cloud computing option that would allow it to purchase and maintain the software and infrastructure itself. The cloud also needs to be designed in such a way that all users of the organization can access it without any lag. Which cloud computing option would be most suitable for GuardIN?

Explanation:

3 0
3 years ago
Other questions:
  • What is one concern associated with web-based applications?
    12·1 answer
  • Which type of JPEG image records the most information in the digital file? Medium Low Fine Expert
    6·2 answers
  • Principles of defensive driving include:
    15·1 answer
  • I have a question on an IT crossword the question is as follows
    12·1 answer
  • Fourlotts Corp. provide integrated services that include storing manufactured goods, packaging, and delivering it to the dealers
    13·1 answer
  • Which of the following variable names is not valid? 1price 1 price price 1 price1
    15·2 answers
  • I have a very quick question. So im applying for Early college and i need some future educational goals and maybe im just thinki
    6·1 answer
  • No down payment, 18 percent / year, payment of $50/month, payment goes first to interest, balance to principal. Write a program
    9·1 answer
  • What are the components of computer system??<br>​
    10·2 answers
  • Why is it useful to understand coding fundamentals even if you work in a game design role that doesn’t traditionally write code?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!