
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
11 questions
Solve Literal Equations
Presentation
•
9th Grade
11 questions
Variety
Presentation
•
KG
11 questions
For loops
Presentation
•
8th - 10th Grade
10 questions
Lesson: Solve Systems by Substitution (part 1)
Presentation
•
9th Grade
10 questions
Area Review
Presentation
•
9th Grade
10 questions
Unit 7.2 Mechanisms of Evolution Notes
Presentation
•
9th Grade
10 questions
2.4 Day 2 Solving Multi-Step Inequalities
Presentation
•
9th Grade
11 questions
TEOREMA DE PITÁGORAS
Presentation
•
9th Grade
Popular Resources on Wayground
6 questions
PRIDE Always and Everywhere
Presentation
•
12th Grade
20 questions
Lab Safety Quiz
Quiz
•
6th Grade
26 questions
KOR Review Kahoot Questions
Quiz
•
8th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
12 questions
Unit Zero lesson 2 cafeteria
Presentation
•
9th - 12th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
10 questions
Riddles Riddles fun Riddles
Quiz
•
6th - 12th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade