Engineering

Computer ScienceQ&A LibraryAdd each element in origList with the corresponding value in offsetAmount. Print each sum followed by a space. Ex: If origList = {40, 50, 60, 70} and offsetAmount = {5, 7, 3, 0}, print: 45 57 63 70 #include <iostream>#include <vector>using namespace std; int main() {const int NUM_VALS = 4;vector<int> origList(NUM_VALS);vector<int> offsetAmount(NUM_VALS);unsigned int i; for (i = 0; i < origList.size(); ++i) {cin >> origList.at(i);} for (i = 0; i < offsetAmount.size(); ++i) {cin >> offsetAmount.at(i);} cout << endl; return 0;} Please help me with this problem using c++.Question

Add each element in origList with the corresponding value in offsetAmount. Print each sum followed by a space. Ex: If origList = {40, 50, 60, 70} and offsetAmount = {5, 7, 3, 0}, print: 45 57 63 70

#include <iostream>

#include <vector>

using namespace std;

int main() {

const int NUM_VALS = 4;

vector<int> origList(NUM_VALS);

vector<int> offsetAmount(NUM_VALS);

unsigned int i;

for (i = 0; i < origList.size(); ++i) {

cin >> origList.at(i);

}

for (i = 0; i < offsetAmount.size(); ++i) {

cin >> offsetAmount.at(i);

}

cout << endl;

return 0;

}

Please help me with this problem using c++.

Tagged in

Find answers to questions asked by student like you

Q: Twin primes are two primes that differ by 2 (e.g., 3 and 5, 101 and 103). Write a c++ program that o...

A: Twin primes are two primes that differ by 2 (e.g., 3 and 5, 101 and 103).Comment are the not readabl...

Q: EXPLAIN ALL STEPS: Determine the output of the following Pep/9 machine language program if the input...

A: Address Instruction(in hex)0000 D1FC15Convert the instructions into binary form-D=11011=00...

Q: WHAT IS A DOUBLE SPEND PROBLEM OF DITIAL CASH TRANSACTION? HOW THE DOUBLE SPEND PROBLEM OF DIGITAL C...

A: Double spending: It means spending the same amount of money twice. Here's a good example to explain ...

Q: What are the mantissa and exponent values if 6.75 is represented in 8 bit binary floating point repr...

A: Calculating the mantissa and exponent of 6.75 with 8-bit binary floating-point representation.Firstl...

Q: I am having trouble writing a python program that opens a file that contains baby names. One file fo...

A: To run this code, make all the files Boys.txt, Girls.txt and .py files in same folder.input() is use...

Q: A network topology specifies how computers, printers, and other devices are connected over a network...

A: The adjacency matrix shows the neighbor it is connected to, so for ring topology is all nodes are co...

Q: I need help with Excel in my Intro to info systems. The thing i don't know how to do is this: It kee...

A: To solve this question user must know the definition of absolute reference:Absolute reference: An ab...

Q: Form boolean equations in POS and SOP forms from the truth table attached (PLEASE EXPLAIN ALL STEPS)...

A: The circuit diagrams that correspond to the following Boolean equations drawed using an online tool...

Q: Siobhan’s laptop has 8GB of RAM. Her operating system takes up 2GB, and her application programs use...

A: Random Access Memory (RAM):RAM is a memory device used for storage purposes.The data stored in the m...