
![[iGCS] Array](https://cf.quizizz.com/img/presentation/default-img/presentation_title_img-3_people.jpg?w=200&h=200)
[iGCS] Array
Presentation
•
Computers
•
9th Grade
•
Practice Problem
•
Easy
Andy tsui
Used 15+ times
FREE Resource
10 Slides • 4 Questions
1
[iGCS] Array

2
Objectives
What is array and the terminology related
Array in pseudocode
Array in Python
3
Imagine you need to have a health monitor program
Enter name of the user
Enter body temperature in day 1
Enter body temperature in day 2
4
Open Ended
Write Pseudocode for the application mentioned before!
5
Same application, but 14 days...
The data need to be stored (for future use)
And maybe longer than 14 days....
For loop can help
6
So if we use for loop, it should be something like:
FOR i <- 1 TO 14:
⠀INPUT day-i
NEXT i
Since the day-i is repeating, but can we do that?
7
Array
Array is a collection of variable
All of them are same data type
And similar kind of data
8
Declare array
# Both of the followings will declare an array of n elements
DECLARE temperatures[0..n-1]
DECLARE temperatures[1..n]
Note:
Array size, or number of element, is fixed once it is declared
9
Fill in the Blanks
Type answer...
10
Accessing the array elements
We use [square brackets] to indiciate which element we are accessing:
DECLARE temperatrues[0..13]
temperatures[0] = 37.5
# So the above example, we called "0" is the index of the first element of the array
11
A few key terms:
index: the location of an item in an array. In Python index starts from 0
size: how many items in the array, array size is fixed
element: each item in the array
12
Open Ended
Write the Pseudocode to declare an array of "scores", which consisted of 24 elements.
13
Open Ended
DECLARE scores[0..23]
Write the Pseudocode to assign 100 to first score.
14
Python array Practice
Declare an array for 14 temperatures (float) data
Write a for-loop to enter those temperatures data, with proper prompt
Write another for-loop to calculate the average of those inputted temperature
[iGCS] Array

Show answer
Auto Play
Slide 1 / 14
SLIDE
Similar Resources on Wayground
11 questions
Arc Length and Sector Area
Presentation
•
9th Grade
11 questions
future perfect
Presentation
•
9th Grade
10 questions
UNIT 5- K9
Presentation
•
9th Grade
10 questions
FUNGSI MENU DAN IKON
Presentation
•
9th Grade
10 questions
System of Linear Inequalities
Presentation
•
9th Grade
10 questions
Erosion by Wind & Waves
Presentation
•
9th Grade
10 questions
MULTIPLE ALLELES
Presentation
•
9th Grade
11 questions
Linear Inequality Symbols + Graphs
Presentation
•
9th Grade
Popular Resources on Wayground
24 questions
PBIS-HGMS Day 10
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Review 3
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
15 questions
HCS SCI 05 Summer School Assessment 3 Review
Quiz
•
5th Grade
35 questions
Lufkin Road Middle School Student Handbook & Policies Assessment
Quiz
•
7th Grade
18 questions
Geo 11.3 Area of Circles and Sectors
Quiz
•
9th - 11th Grade