Repetition Structure – Counters and Accumulators - Visual Basic Questions and Answers

1.

______________ is a numeric variable used for counting something.

   A.) Accumulator
   B.) Positive
   C.) Negative
   D.) Counter

Answer: Option 'D'

Counter

Counter is a numeric value used for counting something and accumulator is a valued used for accumulating something, such as adding, such as total amount of a month earned by a person etc.

DigitalOcean Referral Badge

2.

____________ is a numeric variable used for accumulating something.

   A.) Accumulator
   B.) Counter
   C.) Negative
   D.) Positive

Answer: Option 'B'

Counter

Counter is a numeric value used for counting something and accumulator is a valued used for accumulating something, such as adding, such as total amount of a month earned by a person etc.

DigitalOcean Referral Badge

3.

_____________means to assign a beginning value to the counter or accumulator.

   A.) Initializing
   B.) Updating
   C.) Incrementing
   D.) Checking

Answer: Option 'A'

Initializing
Initializing means to assign a beginning value to the counter or accumulator. Typically, counters and accumulators are initialized to the number 0. However, they can be initialized to any number, depending on the value required by the procedure.

DigitalOcean Referral Badge

4.

_______________ means adding a number to the value stored in the accumulator or counter.

   A.) Initializing
   B.) Backtracking
   C.) Updating
   D.) Checking

Answer: Option 'C'

Updating

Updating often referred to as incrementing, means adding a number to the value stored in the counter or accumulator. The number can be either positive or negative, integer or non-integer. A counter is always updated by a constant value—typically the number 1—whereas an accumulator is updated by a value that varies.

DigitalOcean Referral Badge

5.

When a checkbox’s ____________ property is set to true, it can both accept and display multiple lines of text.

   A.) Multiline Property
   B.) ReadOnly Property
   C.) ReadWrite Property
   D.) ScrollBars Property

Answer: Option 'A'

Multiline Property
When a text box’s Multiline property is set to True, the text box can both accept and display multiple lines of text; otherwise, only one line of text can be entered in the text box, that is when the property is set to false, it can only accept and display one line of text.

DigitalOcean Referral Badge

6.

A text box’s _____________ property specifies whether the text box has scroll bar.

   A.) Multiline Property
   B.) ReadOnly Property
   C.) ReadWrite Property
   D.) ScrollBars Property

Answer: Option 'D'

A text box’s ScrollBars property specifies whether the text box has scroll bar. A text box’s ScrollBars property specifies whether the text box has no scroll bars (the default), a horizontal scroll bar, a vertical scroll bar, or both horizontal and vertical scroll bars.

DigitalOcean Referral Badge

7.

The instruction above the loop is known as the ______________

   A.) Priming read
   B.) Before read
   C.) Reading
   D.) After read

Answer: Option 'A'

Priming read

The instruction above the loop is referred to as the priming read, because it is used to prime (prepare or set up) the loop. The priming read initializes the loop condition by providing its first value.

DigitalOcean Referral Badge

8.

The instruction in the loop body is referred to as ______________

   A.) Priming read
   B.) After read
   C.) Before read
   D.) Update read

Answer: Option 'D'

Update read

The instruction in the loop body is referred to as the update read, because it allows the user to update the value of the input item (in this case, the sales amount) that controls the loop’s condition. The update read is often an exact copy of the priming read. Keep in mind that if you don’t include the update read in the loop body, there will be no way to enter a value that will stop the loop after it has been processed the first time. This is because the priming read is processed only once.

DigitalOcean Referral Badge

9.

The _______________ allows you to abbreviate an assignment statement.

   A.) Arithmetic assignment operator
   B.) Shorthand operator
   C.) Predefined operator
   D.) Long operator

Answer: Option 'A'

Arithmetic assignment operator
The arithmetic assignment operators allow you to abbreviate an assignment statement that contains an arithmetic operator, as long as the assignment statement has the following format, in which variableName is the name of the same variable: variableName = variableName arithmeticOperator value. For example, you can use the addition assignment operator (+=) to abbreviate the statement intAge = intAge + 1 as follows: intAge += 1. Both statements tell the computer to add the number 1 to the contents of the intAge variable and then store the result in the intAge variable.

DigitalOcean Referral Badge

Repetition Structure – Counters and Accumulators - Visual Basic Questions and Answers Download Pdf

Recent Posts