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
astraxan [27]
3 years ago
6

Resize vector countDown to have newSize elements. Populate the vector with integers {newSize, newSize - 1, ..., 1}. Ex: If newSi

ze = 3, then countDown = {3, 2, 1}, and the sample program outputs:
#include
#include
using namespace std;
int main() {
vector countDown(0);
int newSize = 0;
int i = 0;
newSize = 3;
STUDENT CODE
for (i = 0; i < newSize; ++i) {
cout << countDown.at(i) << " ";
}
cout << "Go!" << endl;
return 0;
}
Computers and Technology
1 answer:
strojnjashka [21]3 years ago
4 0

Answer:

Following are the code to the given question:

#include <iostream>//defining header file

#include <vector>//defining header file

#include <numeric>//defining header file

using namespace std;

int main()//main method

{

vector<int> countDown(0);//defing an integer array variable countDown

int newSize = 0;//defing an integer variable newSize that holds a value 0

int i = 0;//defing an integer variable i that initialize with 0

newSize = 3;// //use newSize to hold a value

countDown.resize(newSize,0);// calling the resize method that accepts two parameters

for (i = 0; i < newSize; ++i)//defining a loop that reverse the integer value

{

countDown[i] = newSize -i;//reverse the value and store it into countDown array

cout << countDown.at(i) << " ";//print reverse array value

}

cout << "Go!" << endl;//print message

return 0;

}

Output:

3 2 1 Go!

Explanation:

In the given code inside the main method an integer array "countDown" and two integer variables "newSize and i" is declared that initializes a value that is 0.

In the next step, an array is used that calls the resize method that accepts two parameters, and define a for a loop.

In this loop, the array is used to reverse the value and print its value with the message.

You might be interested in
Does anyone know to get Google updated if it failed to update?
Yuri [45]
You adapt the situation and overcome the situation, look it up this is not school relevant
4 0
4 years ago
Is a growing network of physical objects that have sensors connected to the internet?
dimulka [17.4K]
"growing network of physical objects that will have sensors connected to the internet referred to as the internet of - things"
5 0
3 years ago
Refer to the exhibit. A company is deploying an IPv6 addressing scheme for its network. The company design document indicates th
tangare [24]

Answer:

Maximum number of subsets that can be achieved per sub-site is 16.

Explanation:

IPV6 is the most latest internet protocol.Following is an example of IPV6 ip address

2001:cdba:0000:0000:0000:0000::/64

In IPV6 all zeros can be omitted or can be replaced with a single zero.

So we can write it as

2001:cdba:0000::/64

First zero in here represent site

2nd and third zero represent subsite.

4th zero represent subnet.

0 here is representation of subnet  which is a hexadecimal value.

A single hexadecimal value can have following 16 values

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

8 0
3 years ago
The most frequently applied heuristic in problem solving is a(an) _________, which involves repeated tests for differences betwe
Dvinal [7]

Answer:

means-ends analysis

Explanation:

<h2><u>Fill in the blanks</u></h2>

The most frequently applied heuristic in problem solving is a <u>means-end analysis,</u>  which involves repeated tests for differences between the desired outcome and what currently exists.

8 0
4 years ago
Which arcade game, released in 1972, is considered to be the first to be commercially successful?.
nikitadnepr [17]

Answer:

Pong

Explanation:

Pong

4 0
2 years ago
Other questions:
  • Jamie posted all the journal entries into ledgers. After the postings, Jamie realizes that the debit side of the travel account
    10·1 answer
  • Determine and prove whether an argument in English is valid or invalid. About Prove whether each argument is valid or invalid. F
    5·1 answer
  • An installed theme can be applied by clicking on a theme in the themes group on the ____ tab.
    7·2 answers
  • Jerry is having trouble finding the information that he needs from his search results. Which technique would you suggest he use
    14·2 answers
  • Does anyone know what type of Honda this is and the year of it lol this isn’t school related
    10·1 answer
  • Every presentation should have a beginning, a middle, and an end.
    10·1 answer
  • Why Do You Need to Set Goals for a LinkedIn Automation Campaign?
    15·1 answer
  • Which of the following describes all illustrations created by freehand?
    15·1 answer
  • Creation of network is known as…?
    12·2 answers
  • 4. //Program prompts users for names and quantities for a $2.00 product and displays total for each user until “XXX” is entered
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!