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
If you were to broadcast a live feed of the event, which type of editing would you choose?
Naily [24]
I would use instagram live
8 0
3 years ago
Consider the conditions and intentions behind the creation of the internet—that it was initially created as a tool for academics
svp [43]

It should be noted that the intention for the creation of the internet was simply for resources sharing.

The motivation behind the creation of the internet was for resources sharing. This was created as a tool for academics and federal problem-solvers.

It transpired as it wasn't for its original purpose anymore. Its users employed it for communication with each other. They sent files and softwares over the internet. This led to the security vulnerabilities that can be seen today.

Learn more about the internet on:

brainly.com/question/2780939

5 0
3 years ago
Why is transmitting information through computers cheap and fast
Novay_Z [31]

<em>Hey there!</em>

Just to be corny, what does a spider use to navigate the internet? <em>The World Wide Web!  </em>Did you catch that? Hopefully you did...

Anyway, enough with my jokes, here's your answer.

Transmitting information through computers are cheap and fast because of multiple things. The first reason is because they don't require a deliverer or shipping. They can literally be sent from anywhere and be delivered within 10 seconds-5 minutes, way faster than any mailman or delivery. How does it move that fast? Smaller files tend to move quicker among the invisible online delivery lines, most commonly known as cell towers. To get online info from your phone/computer to someone else's device, the file bounces from tower to tower to finally reach the destination.

<em>I'm always open to any question or comment!</em>

<em>God Bless!</em>

<em>-X8lue83rryX</em>

5 0
3 years ago
When using a public computer or network, you should always _______.
yaroslaw [1]
When using a public computer or network, you should always browse appropriately and log out of personal accounts when you're done. 
6 0
3 years ago
Read 2 more answers
Write a HTML program as shown in the output.​
Vitek1552 [10]

Explanation:

<html>

<title>first term 9/<title>

<head>SUNGHAVA SHIKSHA NIKETANA</head>

<body>

<h1>maths formula</h1>

<h6>a2-b2=(a+b)(A-B)</h6>

<h1>list of exams<\h1>

<h6>1.computer,2.english,3science</h6>

</body>

</html>

3 0
3 years ago
Other questions:
  • Do all websites use the same coding to create?
    12·1 answer
  • Local variables:A. Lose the values stored in them between calls to the method in which the variable is declared
    8·1 answer
  • What does an animation sequence action do?
    12·2 answers
  • Big data: options:
    8·1 answer
  • The ArrayList class ____ method returns the current ArrayList size.
    8·1 answer
  • Wireshark is an example of what type of utility? A) Packet sniffer B) Port scanner C) Vulnerability scanner D) Content filter
    11·1 answer
  • For LG, on the app Messages, will the delete button on the upper right corner cancel a sending message?
    12·1 answer
  • Which of these is an example of a mobile app?
    12·2 answers
  • Why would students most likely need to collect data? Check all that apply.
    12·2 answers
  • A human subject’s photographs show two catchlights in each eye that are unwanted by the photographer. What is the most likely ca
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!