Search Header Logo
CAI 711 - Week 4 P1

CAI 711 - Week 4 P1

Assessment

Presentation

Computers

12th Grade

Practice Problem

Easy

Created by

Hudha Habeeb

Used 1+ times

FREE Resource

9 Slides • 6 Questions

1

CAI - 711
Recap- Milestone

Week 4- P1
Topic : Getting started with swift programming
Subtopic: Recap and Milestone

2

Learning Objectives

  1. Recap topic 1 - Subtopics

  2. Milestone Task1, task 2 and Task 3 to be completed

3

Multiple Choice

What feature of swift makes the programming language safe to use?

1

Type inference

2

type error

3

type safety

4

type data

4

Multiple Choice

How do you display "Hello World" in Swift?

1

print("Hello World")

2

echo("Hello World")

3

System.out.println("Hello World")

4

console.log("Hello World")

5

Multiple Choice

Which keyword is used to declare a constant in Swift?

1

let

2

var

3

constant

4

final

6

Declared with let, values are fixed after initialization.

Constants

Declared with var, values can be changed.

Variables

Variables vs. Constants

7

Example

var myVariable = 10

myVariable = 20 // Allowed

let myConstant = 10

myConstant = 20 // Error: Cannot assign to value: 'myConstant' is a 'let' constant

8

Arithmetic Operators

var sum = 10 + 5

var difference = 10 - 5

var product = 10 * 5

var quotient = 10 / 5

var remainder = 10 % 3

9

Compound Operators

var number = 10

number += 5 // Equivalent to number = number + 5

10

Boolean Operators

let isSunny = true

let isWeekend = false

if isSunny && isWeekend {

print("Perfect day for a picnic!")

}

11

Fill in the Blank

Logical Operators :

let age = 18

if age __ 18

{

print("You are an adult.")

}

>
=

12

Fill in the Blank

Converting if-else statements to ______ can simplify complex conditional logic.

13

Switch Syntax

let day = 3

switch day {

case 1:

print("Monday")

case 2:

print("Tuesday")

case 3:

print("Wednesday")

default:

print("Another day")

}

14

media

Complete and SUBMIT - MILESTONE TASK1, TASK 2, TASK 3

15

Poll

What is completed?

only task 1

Task 1 and Task 2 started

Task 1, Task 2 Completed.
Task 3 Started

All Completed

CAI - 711
Recap- Milestone

Week 4- P1
Topic : Getting started with swift programming
Subtopic: Recap and Milestone

Show answer

Auto Play

Slide 1 / 15

SLIDE