Exercise - For-In Loops Create a for-in loop that loops through values 1 to 100, and prints each of the values. for counter in 1...100 { print(counter) 6 7 8 } 10 Create a for-in loop that loops...


How do I do the following exercise on for in loops using Swift code? Please explain your reasoning using comments. This is the whole question.



Exercise - For-In Loops<br>Create a for-in loop that loops through values 1 to 100, and prints each of the values.<br>for counter in 1...100 {<br>print(counter)<br>6<br>7<br>8<br>}<br>10<br>Create a for-in loop that loops through each of the characters in the alphabet string below, and prints each of the values alongside the index.<br>12<br>let alphabet =

Extracted text: Exercise - For-In Loops Create a for-in loop that loops through values 1 to 100, and prints each of the values. for counter in 1...100 { print(counter) 6 7 8 } 10 Create a for-in loop that loops through each of the characters in the alphabet string below, and prints each of the values alongside the index. 12 let alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 13 for letters in alphabet { 14 print(letters) 15 } 16 17 18 Create a [String: String] dictionary, where the keys are names of states and the values are their capitals. Include at least three key/value pairs in your collection, then use a for-in loop to iterate over the pairs and print out the keys and values in a sentence.

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here