0% found this document useful (0 votes)
91 views2 pages

BTEC Record of Practical Activity Template

Uploaded by

manhquynh1303203
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views2 pages

BTEC Record of Practical Activity Template

Uploaded by

manhquynh1303203
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

BTEC Record of Practical Activity

*Observation Record *Witness Statement


*please delete as applicable

Learner name:
Doan Quang Tu

Qualification:
BTEC Level 5 HND Diploma in Computing
Unit or Component
number & title: Programming
Name of *Observer/
*Witness: Nguyen Thi Hong Hanh
*please delete as applicable
20/2/2024
Date of Activity:

Assessment criteria targeted:

Description of activity undertaken:


10. Array, Array Length, Loop Through an Array

In programming, an array is a data structure used to store a set of values of the same data type,
arranged in a certain order. Here's how to use arrays, calculate array length, and iterate through
array elements using loops in C#:

1. **Array**: To declare an array in C#, you can use the following syntax:
```csharp
// Declare an array of type int with 5 elements
int[] numbers = new int[5];
```

2. **Array Length**: The length of an array is the number of elements in that array. To get the length
of an array in C#, you can use the `Length` property:
```csharp
int[] numbers = { 1, 2, 3, 4, 5 };
int length = numbers.Length; // The length of the array is 5
```

3. **Loop Through an Array**: To iterate through the elements of an array in C#, you can use loops
like `for`, `foreach`, or `while`:
- Use `for` loop:
```csharp
int[] numbers = { 1, 2, 3, 4, 5 };
for (int i = 0; i < numbers.Length; i++)
{
Console.WriteLine(numbers[i]);
}

Author: VQAM Page 1 of 2 Version: 1.3


Approver: VQAM Lead Public Date: 19 July 2023
```
- Use `foreach` loop:
```csharp
int[] numbers = { 1, 2, 3, 4, 5 };
foreach (int number in numbers)
{
Console.WriteLine(number);
}
```
- Use `while` loop:
```csharp
int[] numbers = { 1, 2, 3, 4, 5 };
int index = 0;
while (index < numbers.Length)
{
Console.WriteLine(numbers[index]);
index++;
}
```

Thus, the above examples help you understand how to use arrays, calculate the length of arrays and
iterate through array elements using loops in the C# programming language.
Please state the evidence this record is in support of:

I confirm this is an accurate record of the activity undertaken

Learner signature: Date: 20/2/2024

*Assessor/*Witness signature:
Nguyen Thi Hong Hanh
*please delete as applicable

Role: Lecturer Date: 20/2/2024

Electronic signatures are acceptable on all assessment and internal verification documentation if there is an audit
trail to support its authenticity. This includes a scanned signature or the individual's centre based email address. A
font style is not accepted. Please see the Centre Guide to Internal Verification for further details.

BTEC Record of Activity v2.0 June 2016


Prepared by Internal Assessment QDAM

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy