subject

C++ Add each element in origList with the corresponding value in offsetAmount. Print each sum followed by a semicolon (no spaces). Ex: If origList = {4, 5, 10, 12} and offsetAmount = {2, 4, 7, 3}, print:
6;9;17;15;

#include
#include
using namespace std;

int main() {
const int NUM_VALS = 4;
int origList[NUM_VALS];
int offsetAmount[NUM_VALS];
int i;

cin >> origList[0];
cin >> origList[1];
cin >> origList[2];
cin >> origList[3];

cin >> offsetAmount[0];
cin >> offsetAmount[1];
cin >> offsetAmount[2];
cin >> offsetAmount[3];

/* Your code goes here */

cout << endl;

return 0;
}

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 02:00, vane1161
Aletter or menu command that starts an action when the user presses the designated letter and the alt key together is called what?
Answers: 1
image
Computers and Technology, 22.06.2019 11:50, nicoleskertich
You have written, as part of a school assignment, a research paper on the solar system. you want to share this paper on your school website. on which type of server will you upload it?
Answers: 1
image
Computers and Technology, 22.06.2019 14:30, qxchung7310
The “rule of 72” is used to approximate the time required for prices to double due to inflation. if the inflation rate is r%, then the rule of 72 estimates that prices will double in 72/r years. for instance, at an inflation rate of 6%, prices double in about 72/6 or 12 years. write a program to test the accuracy of this rule. for each interest rate from 1% to 20%, the program should display the rounded value of 72/r and the actual number of years required for prices to double at an r% inflation rate. (assume prices increase at the end of each year.)
Answers: 1
image
Computers and Technology, 22.06.2019 17:40, math31343
Gabe wants to move text from one document to another document. he should copy the text, paste the text, and open the new document highlight the text, select the cut command, move to the new document, make sure the cursor is in the correct location, and select the paste command select the save as command, navigate to the new document, and click save highlight the text, open the new document, and press ctrl and v
Answers: 1
You know the right answer?
C++ Add each element in origList with the corresponding value in offsetAmount. Print each sum follow...

Questions in other subjects:

Konu
Mathematics, 08.02.2021 02:10
Konu
Mathematics, 08.02.2021 02:10