In this lab, you will learn the basics of Swift language and essential programming concepts. By completing the tasks, you will gain proficiency in working with variables, constants, data types, control flow statements, collections, and strings.
Instructions:
Create an empty Swift playground project.
Follow the step-by-step instructions for each task below.
Requirements:
Xcode v13 or higher installed
Swift compiler v5.7 or higher installed
Tasks:
Task 1: Variable Practice
Declare a variable called "score" and assign it an integer value.
Update the value of "score" by adding 10 to it.
Print the updated score.
Task 2: Control Flow
Use the "if/else" statement to check if the score is greater than 9.
If the score is greater than 9, print "Pass," otherwise print "Fail."
Task 3: Loop Practice
Create an array of names with at least 5 elements.
Use a "for" loop to print each name in the array.
Task 4: Working with Dictionaries
Create a dictionary with key-value pairs representing fruit names and their corresponding quantities (e.g., "apple": 3).
Use a "for-in" loop to print each fruit name and its quantity.
Task 5: String Interpolation
Declare a constant "name" with your name as a string.
Use string interpolation to print a welcome message that includes your name.
Submission Guidelines:
Create new repository name it as "iOS-Developemnt-Bootcamp-July-2023-Week-1-Day-2-Lab".
Upload your project files to the repo you just created.
Submit your project repo link as comment down below.
Grading Criteria:
Your lab assignment will be graded based on the following criteria:
Correctness and completion of tasks (50%)
Code quality, readability, and adherence to best practices (50%)
Additional Notes:
You may ask the lab instructor for assistance during lab hours.
Avoid plagiarism; write the code yourself.
Late submissions will not be accepted without prior approval.
Deadline:
Submit your completed lab assignment prior start of next session.
Objective:
In this lab, you will learn the basics of Swift language and essential programming concepts. By completing the tasks, you will gain proficiency in working with variables, constants, data types, control flow statements, collections, and strings.
Instructions:
Requirements:
Tasks:
Task 1: Variable Practice
Task 2: Control Flow
Task 3: Loop Practice
Task 4: Working with Dictionaries
Task 5: String Interpolation
Submission Guidelines:
Grading Criteria:
Your lab assignment will be graded based on the following criteria:
Additional Notes:
Deadline:
Submit your completed lab assignment prior start of next session.