100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Examen

Programming Logic and Design Chap. 8 Arrays Complete Answers

Puntuación
-
Vendido
-
Páginas
6
Grado
A+
Subido en
22-03-2025
Escrito en
2024/2025

Programming Logic and Design Chap. 8 Arrays Complete Answers

Institución
Programming Logic And Design
Grado
Programming Logic and Design









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Programming Logic and Design
Grado
Programming Logic and Design

Información del documento

Subido en
22 de marzo de 2025
Número de páginas
6
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

Programming Logic and Design Chap.
8 Arrays Complete Answers



Each element of the array has a unique number called a subscript that identifies it

the subscript always starts at 0

Assigning values can be done individually using a subscript

Include example

What is a more effective way to step through the array - ANSWER-Set numbers[0] =
20 Set numbers[1] = 30
Set numbers[2] = 40 Set numbers[3] = 50 Set numbers[4[ = 60

But, it is much more efficient to use a Loop to step through the array

Arrays can be initialized to 0 or specific values

What should be done to avoid use of an invalid subscript - ANSWER-Array bounds
checking should be performed to avoid use of an invalid subscript

A common error is running a loop one time more than is
necessary, exceeding the bound of the array

Off-by-one Error

What is a partial filled array - ANSWER-To avoid processing the unfilled elements,
you must have an accompanying integer variable that holds the number of items
stored in the array

When the array is empty, 0 is stored in this variable

The variable is incremented each time an item is added to
the array

The variable's value is used as the array's size when stepping through the array

Other information - ANSWER-The For Each Loop

Some languages provide a For Each loop

It works with an array, iterating once for each array
element

During each iteration, the loop copies an element's value to a variable.

, For Each example: - ANSWER-Constant Integer SIZE = 5
Declare Integer numbers[SIZE] = 5, 10, 15, 20, 25
Declare Integer num


For Each num In numbers
Display num
End For

What is a sequential teach algorithm - ANSWER-A sequential search algorithm is a
simple technique for finding an item in a string or numeric array

Uses a loop to sequentially step through an array

Compares each element with the value being searched for

More information - ANSWER-Totaling the values in an array and calculating
average

Loops are used to accumulate the values

Then, the total is simply divided by the size

Finding the highest and lowest values in an array - ANSWER-The highest

Create a variable to hold the highest value

Assign the value at element 0 to the highest

Use a loop to step through the rest of the elements

Each iteration, a comparison is made to the highest variable

If the element is greater than the highest value, that value is then the assigned to the
highest variable


The lowest

Same process, but checks if the element is less than the lowest value

Copying an array can be done using loops - ANSWER-Copying an array can be
done using loops
For index = 0 to SIZE - 1
Set secondArray[index] = firstArray[index]
End For

Passing an Array as an Argument
$13.99
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada


Documento también disponible en un lote

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
lectknancy Boston University
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
285
Miembro desde
2 año
Número de seguidores
28
Documentos
26010
Última venta
1 semana hace

3.6

57 reseñas

5
23
4
10
3
11
2
3
1
10

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes