For any element in keysList with a value greater than 100, print the corresponding value in itemsList, followed by a space. Ex: If keysList = {42, 105, 101, 100} and itemsList = {10, 20, 30, 40}, print: 20 30Since keysList.at(1) and keysList.at(2) have values greater than 100, the value of itemsList.at(1) and itemsList.at(2) are printed.#include <iostream>#include <vector>using namespace std;int main() {const int SIZE_LIST = 4;vector<int> keysList(SIZE_LIST);vector<int> itemsList(SIZE_LIST);unsigned int i;for (i = 0; i < keysList.size(); ++i) {cin >> keysList.at(i);}for (i = 0; i < itemsList.size(); ++i) {cin >> itemsList.at(i);}/* Your solution goes here */cout << endl;return 0;}Please help me with this problem using c++.

Question
Asked Nov 3, 2019
87 views

For any element in keysList with a value greater than 100, print the corresponding value in itemsList, followed by a space. Ex: If keysList = {42, 105, 101, 100} and itemsList = {10, 20, 30, 40}, print: 20 30

Since keysList.at(1) and keysList.at(2) have values greater than 100, the value of itemsList.at(1) and itemsList.at(2) are printed.

#include <iostream>
#include <vector>
using namespace std;

int main() {
const int SIZE_LIST = 4;
vector<int> keysList(SIZE_LIST);
vector<int> itemsList(SIZE_LIST);
unsigned int i;

for (i = 0; i < keysList.size(); ++i) {
cin >> keysList.at(i);
}

for (i = 0; i < itemsList.size(); ++i) {
cin >> itemsList.at(i);
}

/* Your solution goes here */

cout << endl;

return 0;
}

Please help me with this problem using c++.

check_circle

Expert Answer

star
star
star
star
star
1 Rating
Step 1

The given elements of keysList is {42, 105, 101, 100}

And the given elements of itemsList is {10, 20, 30, 40}

If any element of keysList is greater than 100 then the corresponding element of itemsList is printed.

In this program, the two elem...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: required program java   Create a class called DuplicateCounter. Create an instance method called cou...

A: Program Instructions:In class DuplicateCounter, declare a map of Strings and create methods count() ...

question_answer

Q: Can someone help me on solving this? Thank you!

A: For loop:A loop is used repeatedly to execute a sequence of statements until a given condition is fu...

question_answer

Q: Please put into SOP form~xyz + yz + x~y

A: It is said that a Boolean expression consisting solely of Minterms (product terms) is in the form of...

question_answer

Q: Write a program that will present the user with a main menu of options which the user can choose fro...

A: Program:import java.util.Scanner;public class Main {publicstaticvoid main(String[] args) {char user_...

question_answer

Q: First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ...

A: The name of the program is CharCounter.inputEntry is a string type variable and used for storing use...

question_answer

Q: Hello, I am a novice working with Java. I am creating an amortization schedule (pictured below) and ...

A: Declare and initialize two more double type variable totalamorized and lastamorized.Calculate these ...

question_answer

Q: You will write 4 classes for Program 5.  Assignment:The BankAccount class models an account of a cus...

A: Java Program:Filename :- BankAccount.java// Import the required packageimport java.util.Date;// Clas...

question_answer

Q: Construct a truth table for the following: a) xyz + x(yz)' + x'(y+z) + (xyz)'b) (x + y')(x' + z')(y'...

A: Truth table:a. Given Boolean expression:F = xyz + x(yz)’ + x’(y + z) + (xyz)’

question_answer

Q: How did Cisco systems solve physical security problems?

A: Cisco is a US-based technology corporation best known for its networking services. As a company that...