
Lesson Variables
Presentation
•
Computers
•
9th Grade
•
Practice Problem
•
Medium
Laila Zuaiter
Used 19+ times
FREE Resource
7 Slides • 8 Questions
1
variables
Swiftplayground
Week 2
Computer Science - CSC400
2
Objectives
Define variables as a value that can change, depending on conditions or on information passed to the program under the Swift programming platform.
Identify different types of variables used to store data in Swift programming platform and the way to parse data between them.
Declare a variable and assign a value to it using the Swift programming platform syntax to hold a specific data within a program
3
Objectives
Declare Constants using let command in Swift Programming platform to hold a non-changing variable value.
Use the assignment operator (=) to assign a new value to a variable in a program that matches its defined data type
Identify the scope of the local variables in a programming as an indication of how accessible a variable is to a function or another call within the same program.
Perform arithmetic, increment, decrement, comparison between variables and logical operators to perform different operations on variables
4
Define variable
Variable : A named container that stores a value. The value can change over time.
5
Multiple Choice
Which of the following is the correct definition of a variable?
A function that performs calculations
A storage location in memory with a specific name
A type of loop that repeats actions
A collection of data items
6
Types of variable
let name = "Ahmad". // String
var age = 15 // Integer
var height = 1.6 // float
var isOnClosedSwitch = true //Boolean
7
Multiple Choice
Which of the following types is a String?
let name = "Sara"
var age = 15
let speed = 80.5
var isBlocked = false
8
Multiple Choice
Which of the following types is a float?
let name = "Sara"
var age = 15
let speed = 80.5
var isBlocked = false
9
Multiple Choice
Which of the following types is a boolean?
let name = "Sara"
var age = 15
let speed = 80.5
var isBlocked = false
10
Multiple Choice
Which of the following types is an integer?
let name = "Sara"
var age = 15
let speed = 80.5
var isBlocked = false
11
Declare a constant
Constant: A named Container that stores a value that can't be changed
example:
let name = "Amna"
Variable : a variable that can be modified later
example :
var EnglishMark = 90
12
Multiple Choice
In Swift programming, what keyword is used to declare a variable that can be modified later?
const
var
let
mut
13
Multiple Choice
How do you declare a constant in Swift?
constant myValue = 10
static myValue = 10
let myValue = 10
final myValue = 10
14
Swift playground
Solve Swift playground :
Keeping Track
Bump up the Value
Incrementing the Value
15
Open Ended
Search on the internet and write what are the rules of Naming variable?
variables
Swiftplayground
Week 2
Computer Science - CSC400
Show answer
Auto Play
Slide 1 / 15
SLIDE
Similar Resources on Wayground
10 questions
Perangkat Lunak
Presentation
•
9th Grade
12 questions
Completing the Square (Full process)
Presentation
•
9th Grade
9 questions
DESAFIO_PROVAPR_9_EF_HIST_001
Presentation
•
9th Grade
9 questions
Evolution
Presentation
•
9th Grade
10 questions
Spread of the Cold War - Vietnam War
Presentation
•
9th Grade
10 questions
Le pronom "y"
Presentation
•
9th Grade
10 questions
The Discriminant
Presentation
•
9th Grade
10 questions
Parallel and perpendicular slope
Presentation
•
9th Grade
Popular Resources on Wayground
10 questions
HCS SCI 03 Summer School Review 4
Quiz
•
3rd Grade
11 questions
HSMS - Standard Response Protocol
Quiz
•
6th - 8th Grade
16 questions
1.1-1.2 Quiz Review
Quiz
•
9th - 12th Grade
12 questions
Exponent Expressions
Quiz
•
6th Grade
20 questions
Adding and Subtracting Integers
Quiz
•
6th - 7th Grade
11 questions
Northeast States
Quiz
•
3rd - 4th Grade
10 questions
Characterization
Quiz
•
3rd - 7th Grade
10 questions
Common Denominators
Quiz
•
5th Grade