Question: Program is in Swift, please explain. Thank you! Objective: Practice programming with dictionaries, strings, loops, and functions. References: Sections 2.1 (Strings) and 2.5 (Collections) of

 Program is in Swift, please explain. Thank you! Objective: Practice programming

Program is in Swift, please explain. Thank you!

Objective: Practice programming with dictionaries, strings, loops, and functions. References: Sections 2.1 (Strings) and 2.5 (Collections) of "Application Development with Swift" You are given a dictionary crypt of type [String:String] which has values for all lowercase letters. The crypt dictionary represents a way to encode a message. For example, if crypt["h"]-"@" and crypt["" ..," the encoded version of the message "hi" will be "@l". Part 1: Write code that would take any string containing only lower case letters and spaces and encode it using the crypt dictionary (non-lower case letters can be encoded into themselves) Use the following crypt dictionary to test your code with the string message "hello swift var crypt = [ 1 2 Sample input: crypto swift Expected Output: -ye/.~!! Part 2: Write a function that takes a string and returns its encoded version using the crypt dictionary. Test your function with few sample strings including the sample input above Deliverables: Submit a copy of your code, (2) screen shot of at least two test cases showing your solution meets problem specs above

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!