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
kramer
3 years ago
13

Int[] numList = {2,3,4,5,6,7,9,11,12,13,14,15,16}; int count=0; for(int spot=0; spot

Physics
1 answer:
pickupchik [31]3 years ago
4 0

Hi, there is not much information about what do you need to do, but base on the C++ code you need to complete it to count the number of items in the array, using the instructions already written.

Answer:

#include <iostream>

using namespace std;

int main()

{

   int numList [] = {2,3,4,5,6,7,9,11,12,13,14,15,16};

   int count=0;

   for(int spot=0; spot < (sizeof(numList)/sizeof( numList[ 0 ])); ++spot)

   {

        cout << numList[spot];

        cout << "\n";

        ++count;

   }

   cout << "The number of items in the array is: ";

   cout << count;

   return 0;

}

Explanation:

To complete the program we need to finish the for statement, we want to know the number of items, we can get it by using this expression:  (sizeof(numList)/sizeof( numList[ 0 ])), sizeof() function returns the number of bytes occupied by an  array, therefore, the division between the number of bytes occupied for all the array (sizeof(numList)) by the number of bytes occupied for one item of the array (sizeof( numList[ 0])) equal the length of the array. While iterating for the array we are increasing the variable count that at the end contains the result that we print using the expression cout << "The number of items in the array is: "

You might be interested in
A rocket is fired at a 45° angle, what is the direction of the horizontal velocity vector at the peak height?
Bess [88]

Answer:

B: Horizontally to the left

Explanation:

Horizontal velocity is always constant throughout the entire trajectory of the rocket and acts in the horizontal direction in which the rocket was launched. This is because gravity only acts in the downwards vertical direction.

So in order words at peak height, horizontal velocity is in the horizontal direction in which the rocket was launched.

So if it was to the left, then direction is left but if right, then direction is right.

Looking at the options, the most appropriate will be:

Horizontally to the left

7 0
3 years ago
How do you find the range of a data set?
Helga [31]

The answer is A.

The answer is A.

The answer is A.

6 0
3 years ago
Convert 1.5 radian into milliradians.
Alex

Answer:

1500 milliradians

Explanation:

Data provided in the question:

1.5 radians

Now,

1 radians consists of  1000 milliradians

1 milli = 1000

thus for the 1.5 radians, we have

1.5 radians = 1.5 multiplied by 1000 milliradians

or

1.5 radians = 1500 milliradians

Hence, after the conversion

1.5 radians equals to the value 1500 milliradians

4 0
3 years ago
If the nucleus of an atom contains 12 protons how many electrons are there in a neutral atom why
kicyunya [14]
For a neutral atom number of electrons equals number of protons, in other for the net charge of the atom to be zero...
no. of electrons = 12
7 0
3 years ago
1. The string shown is 1.5 meters long and is vibrating as the first harmonic. The string vibrates up and down with 33 cycles in
svet-max [94.6K]

Answer:

Explanation:

ok

6 0
3 years ago
Other questions:
  • How to calculate wavelength in m when you know the frequency?
    6·1 answer
  • what is the average speed of (a) a car that travels 400m in 20s. and (b) an athlete who runs 1500m in 4 minutes​
    11·1 answer
  • A 37 N block rests on a horizontal surface. The coefficients of static and kinetic friction between the surface and the block ar
    11·1 answer
  • Electric potential is associated with both electric fields due to static charges and induced electric fields. Electric potential
    9·1 answer
  • What equation relates mechanical energy, thermal energy, and total energy when there is friction present in a system?
    11·1 answer
  • A balloon filled with helium gas at 20°C occupies 4.91 L at 1.00 atm. The balloon is immersed in liquid nitrogen at -196°C, whil
    5·1 answer
  • The magnetic field of an electromagnetic wave in a vacuum is Bz =(2.4μT)sin((1.05×107)x−ωt), where x is in m and t is in s. You
    12·1 answer
  • Which of the following organisms has an adaptation that will allow it to survive in tundra biome? *
    5·1 answer
  • Please answer correctly will give brainlist if correct
    12·1 answer
  • What is the magnitude of the resultant vector? Round
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!