Write the pseudocode to define and initialize a five element array called "evens," with even numbers from 2 to 10, and then find the total of the values in the array using a for loop.

What will be an ideal response?


start
   Declarations
      num count = 0
      num evens[5] = 2,4,6,8,10
      num SIZE = 5
    for count 0 to SIZE - 1 step 1
      total = total + evens[count]
      count = count + 1
    endfor
stop

Computer Science & Information Technology

You might also like to view...

Answer the following statements true (T) or false (F)

1. If a base class does not have a parameterless constructor, its derived class constructor must use the notation: base(parameter List) to call one of the base class's parameterized constructors. 2. If a reference to a base class object calls a method that has been overridden by a derived class, the derived class's version of the method is the one that executes. 3. Properties in a base class can be overridden in the same way that methods can be overridden. 4. If a derived class introduces additional methods, properties, or fields, a base class reference variable cannot access them.

Computer Science & Information Technology

Answer the following questions true (T) or false (F)

1. An array behaves like a list of variables each of which is of the same type and for which there is a uniform, convenient naming convention that can be declared in a single line of code. In the explanation, give an example of declaration and access. 2. With arrays, indices start at any number the programmer chooses to indicate in the definition.

Computer Science & Information Technology

____ are special files with listings of filenames and their attributes.

A. Databases B. Directories C. Programs D. Data files

Computer Science & Information Technology

You notice that your computer is running slow and decide to reboot the computer to see if that will fix the problem. During the reboot, you notice that the amount of RAM shown during the RAM count is not the same as it was the day before. ? What might cause this problem?

A. CMOS battery is failing. B. RAM module has become unseated. C. CMOS RAM has become corrupt. D. System is overheating.

Computer Science & Information Technology