Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Integers numEmployees, firstEmployee, middleEmployee, and lastEmployee are read from input. First, declare a vector of integers named runningNumbers with a size of numEmployees. Then, initialize

Integers numEmployees, firstEmployee, middleEmployee, and lastEmployee are read from input. First, declare a vector of integers named runningNumbers with a size of numEmployees. Then, initialize the first, middle, and last element in runningNumbers to firstEmployee, middleEmployee, and lastEmployee, respectively.

Ex: If the input is 10 186 173 180, then the output is:

186 0 0 0 0 173 0 0 0 180 

#include #include using namespace std;

int main() { int numEmployees; int firstEmployee; int middleEmployee; int lastEmployee; unsigned int i;

cin >> numEmployees; cin >> firstEmployee; cin >> middleEmployee; cin >> lastEmployee;

/* Your code goes here */

for (i = 0; i < runningNumbers.size(); ++i) { cout << runningNumbers.at(i) << " "; } cout << endl;

return 0; }

C++ please

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions

Question

=+ Have they changed the way employers view IP?

Answered: 1 week ago